From 08074eb71229b4c9f669f7bfb215bbb43525bfc0 Mon Sep 17 00:00:00 2001 From: "NARUSE, Yui" Date: Wed, 4 Dec 2019 01:26:28 +0900 Subject: Revert "Revert nil error and adding deprecation message" This reverts commit 452bee3ee8d68059fabd9b1c7a75661b14e3933e. --- spec/ruby/core/regexp/match_spec.rb | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'spec/ruby') diff --git a/spec/ruby/core/regexp/match_spec.rb b/spec/ruby/core/regexp/match_spec.rb index f796febc86..89cb3be4f6 100644 --- a/spec/ruby/core/regexp/match_spec.rb +++ b/spec/ruby/core/regexp/match_spec.rb @@ -91,7 +91,7 @@ describe "Regexp#match" do end end - ruby_version_is ""..."3.0" do + ruby_version_is ""..."2.7" do it "resets $~ if passed nil" do # set $~ /./.match("a") @@ -102,13 +102,7 @@ describe "Regexp#match" do end end - ruby_version_is "2.7"..."3.0" do - it "warns the deprecation when the given argument is nil" do - -> { /foo/.match(nil) }.should complain(/given argument is nil/) - end - end - - ruby_version_is "3.0" do + ruby_version_is "2.7" do it "raises TypeError when the given argument is nil" do -> { /foo/.match(nil) }.should raise_error(TypeError) end @@ -147,19 +141,13 @@ describe "Regexp#match?" do /str/i.match?('string', 1).should be_false end - ruby_version_is ""..."3.0" do + ruby_version_is ""..."2.7" do it "returns false when given nil" do /./.match?(nil).should be_false end end - ruby_version_is "2.7"..."3.0" do - it "warns the deprecation" do - -> { /./.match?(nil) }.should complain(/given argument is nil/) - end - end - - ruby_version_is "3.0" do + ruby_version_is "2.7" do it "raises TypeError when given nil" do -> { /./.match?(nil) }.should raise_error(TypeError) end -- cgit v1.2.3