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

refactor: move dependency requires to ruby_runner.rb file #609

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pvdb
Copy link
Contributor

@pvdb pvdb commented Dec 20, 2024

There are three test cases that include the RubyRunner module:

$ git grep -l 'include RubyRunner'
test/test_rake_backtrace.rb
test/test_rake_functional.rb
test/test_rake_reduce_compat.rb
$ _

... which previously required the indirect open3 and fileutils dependencies themselves, so this PR moves the requires to ruby_runner.rb where they belong.

In addition, and in a separate commit to make reviewing easier, this PR also removes some superfluous stringio require statements in two other files that don't actually use StringIO in any of their tests ... this was tested extensively by running each test in isolation (as opposed to "in bulk" using rake test) as follows:

$ git ls-files 'test/test_*.rb'|xargs -n1 ruby
...
$ _

Thanks, @hsbt ! 🙏


PS - a nice side-effect of this refactor is that the ruby_runner.rb file is now "correct" Ruby code, which it currently - on master - isn't:

$ ruby test/support/ruby_runner.rb 
test/support/ruby_runner.rb:3:in `<module:RubyRunner>': uninitialized constant RubyRunner::FileUtils (NameError)

  include FileUtils
          ^^^^^^^^^
Did you mean?  FileTest
	from test/support/ruby_runner.rb:2:in `<main>'

$ _

@pvdb pvdb force-pushed the fix_rubyrunner_require branch from 8773e57 to a205f83 Compare December 20, 2024 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant