summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorNARUSE, Yui <naruse@airemix.jp>2019-12-04 01:26:28 +0900
committerNARUSE, Yui <naruse@airemix.jp>2019-12-04 06:40:54 +0900
commit08074eb71229b4c9f669f7bfb215bbb43525bfc0 (patch)
tree506ba272f8a792ced96d945594335d83d2128114 /spec
parenta705f6472c3e34422776d886bbc9f98676d8c0eb (diff)
Revert "Revert nil error and adding deprecation message"
This reverts commit 452bee3ee8d68059fabd9b1c7a75661b14e3933e.
Diffstat (limited to 'spec')
-rw-r--r--spec/ruby/core/regexp/match_spec.rb20
1 files changed, 4 insertions, 16 deletions
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