diff options
Diffstat (limited to 'spec/ruby/core/module/deprecate_constant_spec.rb')
-rw-r--r-- | spec/ruby/core/module/deprecate_constant_spec.rb | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/spec/ruby/core/module/deprecate_constant_spec.rb b/spec/ruby/core/module/deprecate_constant_spec.rb index faacbea03e..aabef934c4 100644 --- a/spec/ruby/core/module/deprecate_constant_spec.rb +++ b/spec/ruby/core/module/deprecate_constant_spec.rb @@ -31,17 +31,15 @@ describe "Module#deprecate_constant" do -> { @module.const_get :PRIVATE }.should complain(/warning: constant .+::PRIVATE is deprecated/) end - ruby_version_is '2.7' do - it "does not warn if Warning[:deprecated] is false" do - @module.deprecate_constant :PUBLIC1 - - deprecated = Warning[:deprecated] - begin - Warning[:deprecated] = false - -> { @module::PUBLIC1 }.should_not complain - ensure - Warning[:deprecated] = deprecated - end + it "does not warn if Warning[:deprecated] is false" do + @module.deprecate_constant :PUBLIC1 + + deprecated = Warning[:deprecated] + begin + Warning[:deprecated] = false + -> { @module::PUBLIC1 }.should_not complain + ensure + Warning[:deprecated] = deprecated end end end |