Skip to content

Conversation

@tikkss
Copy link
Contributor

@tikkss tikkss commented Jul 10, 2025

GitHub: fix GH-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!!!

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!!!
@tikkss
Copy link
Contributor Author

tikkss commented Jul 10, 2025

I confirmed that ruby-gettext/gettext's tests are successful below:

$ 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

@kou kou merged commit 5f1c2eb into test-unit:master Jul 10, 2025
36 checks passed
@tikkss tikkss deleted the autoload-and-absolute branch July 11, 2025 03:25
@tikkss
Copy link
Contributor Author

tikkss commented Jul 11, 2025

Thanks for your review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use require_relative instead of require

2 participants