Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure URI.from_path is available to minitest runner #3289

Merged
merged 3 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/ruby_lsp/ruby_lsp_reporter_plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# frozen_string_literal: true

require_relative "test_reporter"
require "ruby_indexer/lib/ruby_indexer/uri"

require "minitest"

Expand Down
1 change: 1 addition & 0 deletions project-words
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ quickfixes
quux
quxx
rdbg
rbundler
readlines
realpath
reparsing
Expand Down
7 changes: 5 additions & 2 deletions test/minitest_test_runner_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ module RubyLsp
class MinitestTestRunnerTest < Minitest::Test
def test_minitest_output
plugin_path = "lib/ruby_lsp/ruby_lsp_reporter_plugin.rb"
env = { "RUBYOPT" => "-r./#{plugin_path}" }
_stdin, stdout, _stderr, _wait_thr = T.unsafe(Open3).popen3(
# In Ruby 3.1, the require fails unless Bundler is set up.
env = { "RUBYOPT" => "-rbundler/setup -r./#{plugin_path}" }
_stdin, stdout, stderr, wait_thr = T.unsafe(Open3).popen3(
env,
"bundle",
"exec",
"ruby",
"-Itest",
"test/fixtures/minitest_example.rb",
)
flunk("command failed: #{stderr.read}") unless wait_thr.value.success?

stdout.binmode
stdout.sync = true

Expand Down