ruby-changes:65270
From: Kazuhiro <ko1@a...>
Date: Tue, 16 Feb 2021 18:53:03 +0900 (JST)
Subject: [ruby-changes:65270] 96228e3ed6 (master): Fix a spec failure
https://git.ruby-lang.org/ruby.git/commit/?id=96228e3ed6 From 96228e3ed606856095fec955717d72c815dc6523 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA <zn@m...> Date: Tue, 16 Feb 2021 18:49:48 +0900 Subject: Fix a spec failure http://ci.rvm.jp/logfiles/brlog.trunk-test.20210216-182358 ``` 1) $LOAD_PATH.resolve_feature_path raises LoadError if feature cannot be found FAILED Expected LoadError but no exception was raised (nil was returned) /tmp/ruby/v3/src/trunk-test/spec/ruby/language/predefined_spec.rb:1275:in `block (3 levels) in <top (required)>' /tmp/ruby/v3/src/trunk-test/spec/ruby/language/predefined_spec.rb:1259:in `block in <top (required)>' /tmp/ruby/v3/src/trunk-test/spec/ruby/language/predefined_spec.rb:1258:in `<top (required)>' ``` --- spec/ruby/language/predefined_spec.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/spec/ruby/language/predefined_spec.rb b/spec/ruby/language/predefined_spec.rb index b1f5d80..24a8cf2 100644 --- a/spec/ruby/language/predefined_spec.rb +++ b/spec/ruby/language/predefined_spec.rb @@ -1271,8 +1271,16 @@ ruby_version_is "2.7" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/language/predefined_spec.rb#L1271 path.should.end_with?("/etc.#{RbConfig::CONFIG['DLEXT']}") end - it "raises LoadError if feature cannot be found" do - -> { $LOAD_PATH.resolve_feature_path('noop') }.should raise_error(LoadError) + ruby_version_is "2.7"..."3.1" do + it "raises LoadError if feature cannot be found" do + -> { $LOAD_PATH.resolve_feature_path('noop') }.should raise_error(LoadError) + end + end + + ruby_version_is "3.1" do + it "return nil if feature cannot be found" do + $LOAD_PATH.resolve_feature_path('noop').should be_nil + end end end end -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/