diff --git a/core/data/constants_spec.rb b/core/data/constants_spec.rb index 18f6d4291c..0e47a82e26 100644 --- a/core/data/constants_spec.rb +++ b/core/data/constants_spec.rb @@ -1,15 +1,13 @@ require_relative '../../spec_helper' -ruby_version_is ""..."3.0" do - describe "Data" do - it "is a subclass of Object" do - suppress_warning do - Data.superclass.should == Object - end +describe "Data" do + it "is a subclass of Object" do + suppress_warning do + Data.superclass.should == Object end + end - it "is deprecated" do - -> { Data }.should complain(/constant ::Data is deprecated/) - end + it "is deprecated" do + -> { Data }.should complain(/constant ::Data is deprecated/) end end diff --git a/core/env/index_spec.rb b/core/env/index_spec.rb index a0c90f8eb2..43875f5a50 100644 --- a/core/env/index_spec.rb +++ b/core/env/index_spec.rb @@ -1,14 +1,12 @@ require_relative '../../spec_helper' require_relative 'shared/key' -ruby_version_is ""..."3.0" do - describe "ENV.index" do - it_behaves_like :env_key, :index +describe "ENV.index" do + it_behaves_like :env_key, :index - it "warns about deprecation" do - -> do - ENV.index("foo") - end.should complain(/warning: ENV.index is deprecated; use ENV.key/) - end + it "warns about deprecation" do + -> do + ENV.index("foo") + end.should complain(/warning: ENV.index is deprecated; use ENV.key/) end end diff --git a/core/integer/constants_spec.rb b/core/integer/constants_spec.rb index 35601f82b9..3b8b01e330 100644 --- a/core/integer/constants_spec.rb +++ b/core/integer/constants_spec.rb @@ -1,27 +1,25 @@ require_relative '../../spec_helper' -ruby_version_is ""..."3.0" do - describe "Fixnum" do - it "is unified into Integer" do - suppress_warning do - Fixnum.should equal(Integer) - end +describe "Fixnum" do + it "is unified into Integer" do + suppress_warning do + Fixnum.should equal(Integer) end + end - it "is deprecated" do - -> { Fixnum }.should complain(/constant ::Fixnum is deprecated/) - end + it "is deprecated" do + -> { Fixnum }.should complain(/constant ::Fixnum is deprecated/) end +end - describe "Bignum" do - it "is unified into Integer" do - suppress_warning do - Bignum.should equal(Integer) - end +describe "Bignum" do + it "is unified into Integer" do + suppress_warning do + Bignum.should equal(Integer) end + end - it "is deprecated" do - -> { Bignum }.should complain(/constant ::Bignum is deprecated/) - end + it "is deprecated" do + -> { Bignum }.should complain(/constant ::Bignum is deprecated/) end end diff --git a/core/kernel/match_spec.rb b/core/kernel/match_spec.rb index e8ef320d6f..6dc1eb7de8 100644 --- a/core/kernel/match_spec.rb +++ b/core/kernel/match_spec.rb @@ -14,7 +14,7 @@ end end - ruby_version_is "2.6"..."3.0" do + ruby_version_is "2.6" do it "is deprecated" do -> do Object.new =~ /regexp/ diff --git a/core/module/deprecate_constant_spec.rb b/core/module/deprecate_constant_spec.rb index 6a8086bc8f..7bcced981b 100644 --- a/core/module/deprecate_constant_spec.rb +++ b/core/module/deprecate_constant_spec.rb @@ -10,16 +10,6 @@ @module.private_constant :PRIVATE @module.deprecate_constant :PRIVATE @pattern = /deprecated/ - if Warning.respond_to?(:[]) - @deprecated = Warning[:deprecated] - Warning[:deprecated] = true - end - end - - after :each do - if Warning.respond_to?(:[]) - Warning[:deprecated] = @deprecated - end end describe "when accessing the deprecated module" do diff --git a/language/predefined_spec.rb b/language/predefined_spec.rb index cb0462731b..5ce4e77906 100644 --- a/language/predefined_spec.rb +++ b/language/predefined_spec.rb @@ -654,7 +654,7 @@ def foo -> { $, = Object.new }.should raise_error(TypeError) end - ruby_version_is "2.7"..."3.0" do + ruby_version_is "2.7" do it "warns if assigned non-nil" do -> { $, = "_" }.should complain(/warning: `\$,' is deprecated/) end @@ -693,7 +693,7 @@ def foo $; = nil end - ruby_version_is "2.7"..."3.0" do + ruby_version_is "2.7" do it "warns if assigned non-nil" do -> { $; = "_" }.should complain(/warning: `\$;' is deprecated/) end diff --git a/library/net/http/HTTPServerException_spec.rb b/library/net/http/HTTPServerException_spec.rb index 6800c625f7..87841ab499 100644 --- a/library/net/http/HTTPServerException_spec.rb +++ b/library/net/http/HTTPServerException_spec.rb @@ -13,7 +13,7 @@ end end -ruby_version_is "2.6"..."3.0" do +ruby_version_is "2.6" do describe "Net::HTTPServerException" do it "is a subclass of Net::ProtoServerError and is warned as deprecated" do -> { Net::HTTPServerException.should < Net::ProtoServerError }.should complain(/warning: constant Net::HTTPServerException is deprecated/)