Revert "Use require_relative instead of autoload (#313)"#321
Merged
kou merged 1 commit intotest-unit:masterfrom Jul 5, 2025
Merged
Conversation
This reverts commit 572b28a. GitHub: test-unitGH-320 We need to use another approach for it. Reported by Mamoru TASAKA. Thanks!!! Co-authored-by: Sutou Kouhei <[email protected]>
7b84ac0 to
68996f8
Compare
Contributor
Author
|
I confirmed that $ ruby -I ~/src/github.com/test-unit/test-unit/lib test/run-test.rb --version
run-test 3.7.0
$ ruby -I ~/src/github.com/test-unit/test-unit/lib test/run-test.rb
Loaded suite test/run-test
Started
O
================================================================================================================================================================
Omission: Per thread $SAFE is removed since Ruby 2.6. [test_safe_mode(TestGetText)]
/Users/zzz/src/github.com/ruby-gettext/gettext/test/test_gettext.rb:382:in 'TestGetText#test_safe_mode'
================================================================================================================================================================
Finished in 5.116956 seconds.............
----------------------------------------------------------------------------------------------------------------------------------------------------------------
399 tests, 779 assertions, 0 failures, 0 errors, 0 pendings, 1 omissions, 0 notifications
100% passed
----------------------------------------------------------------------------------------------------------------------------------------------------------------
77.98 tests/s, 152.24 assertions/s |
Contributor
Author
|
Thanks for your review! |
Contributor
|
For what it's worth, I generally accomplish this by just interpolating the expanded path into the dir = File.expand_path("imap", __dir__)
autoload :ConnectionState, "#{dir}/connection_state"
autoload :ResponseReader, "#{dir}/response_reader"
autoload :SASL, "#{dir}/sasl"
autoload :SASLAdapter, "#{dir}/sasl_adapter"
autoload :SequenceSet, "#{dir}/sequence_set"
autoload :StringPrep, "#{dir}/stringprep"If we were willing to override module Test
module Unit
class << self
def autoload(name, path, relative_to: nil)
path = File.expand_path(path, relative_to) if relative_to
super(name, path)
end
end
autoload :TestCase, "test/unit/testcase", relative_to: __dir__
autoload :AutoRunner, "test/unit/autorunner", relative_to: __dir__
end
end |
Contributor
Author
|
Thanks for your knowledge. Sounds nice that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This reverts commit 572b28a.
GitHub: GH-320
We need to use another approach for it.
Reported by Mamoru TASAKA. Thanks!!!