summaryrefslogtreecommitdiff
path: root/test/ruby/test_require.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-04 13:09:30 +0200
committerKazuhiro NISHIYAMA <znz@users.noreply.github.com>2021-02-16 18:11:13 +0900
commit02151dad1ba324fac5f8e9459334164d01893124 (patch)
tree2a3d7a6de67afc8eb2ae06830e69edde7fa1a040 /test/ruby/test_require.rb
parent37b90bcdc17f1cd2c088db7db506ed7f5b2a775f (diff)
`$LOAD_PATH.resolve_feature_path` should not raise
I think it's more friendly and easier to work with to return `nil` when the feature is not found in the $LOAD_PATH.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2317
Diffstat (limited to 'test/ruby/test_require.rb')
-rw-r--r--test/ruby/test_require.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index 30c07b9e5c..973d9c92f1 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -857,5 +857,9 @@ class TestRequire < Test::Unit::TestCase
$:.replace(paths)
$".replace(loaded)
end
+
+ def test_resolve_feature_path_with_missing_feature
+ assert_nil($LOAD_PATH.resolve_feature_path("superkalifragilisticoespialidoso"))
+ end
end
end