Use absolute path instead of relative path for autoload#325
Merged
kou merged 1 commit intotest-unit:masterfrom Jul 10, 2025
Merged
Use absolute path instead of relative path for autoload#325kou merged 1 commit intotest-unit:masterfrom
kou merged 1 commit intotest-unit:masterfrom
Conversation
GitHub: fix test-unitGH-311 This patch will reduce dependency on `$LOAD_PATH`. Using `autoload` with an absolute path means it does not depend on `$LOAD_PATH`. `Test::Unit::TestCase` and `Test::Unit::AutoRunner` are loaded using absolute paths before these constants are referred or redefined with the open class. Suggested by nicholas a. evans. Thanks!!!
Contributor
Author
|
I confirmed that $ ruby -I ~/src/github.com/test-unit/test-unit/lib test/run-test.rb --version
run-test 3.7.1
$ 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.467013 seconds.............
---------------------------------------------------------------------------------------------------------------------------------------------------------------
399 tests, 779 assertions, 0 failures, 0 errors, 0 pendings, 1 omissions, 0 notifications
100% passed
---------------------------------------------------------------------------------------------------------------------------------------------------------------
72.98 tests/s, 142.49 assertions/s |
Contributor
Author
|
Thanks for your review! |
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.
GitHub: fix GH-311
This patch will reduce dependency on
$LOAD_PATH. Usingautoloadwith an absolute path means it does not depend on$LOAD_PATH.Test::Unit::TestCaseandTest::Unit::AutoRunnerare loaded using absolute paths before these constants are referred or redefined with the open class.Suggested by nicholas a. evans. Thanks!!!