diff options
author | Benoit Daloze <[email protected]> | 2019-11-03 11:25:42 +0100 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2019-11-03 11:25:42 +0100 |
commit | 782d1b8fb0a039cedef9ad9c94f432dad51901e6 (patch) | |
tree | 53f68165d2e7fc89dbb7cfa2f6535ce6b7946a26 | |
parent | fbacfe6820cf4f7e115103057b6263cd038da175 (diff) |
Fix warnings in Regexp#{match,match?} specs
-rw-r--r-- | spec/ruby/core/regexp/match_spec.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/spec/ruby/core/regexp/match_spec.rb b/spec/ruby/core/regexp/match_spec.rb index e2075d1dc0..0ce8347d2d 100644 --- a/spec/ruby/core/regexp/match_spec.rb +++ b/spec/ruby/core/regexp/match_spec.rb @@ -89,12 +89,14 @@ describe "Regexp#match" do ruby_version_is ""..."3.0" do it "resets $~ if passed nil" do - # set $~ - /./.match("a") - $~.should be_kind_of(MatchData) + suppress_warning do + # set $~ + /./.match("a") + $~.should be_kind_of(MatchData) - /1/.match(nil) - $~.should be_nil + /1/.match(nil) + $~.should be_nil + end end end @@ -145,7 +147,9 @@ describe "Regexp#match?" do ruby_version_is ""..."3.0" do it "returns false when given nil" do - /./.match?(nil).should be_false + suppress_warning do + /./.match?(nil).should be_false + end end end |