mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fix warnings in Regexp#{match,match?} specs
This commit is contained in:
parent
fbacfe6820
commit
782d1b8fb0
1 changed files with 10 additions and 6 deletions
|
@ -89,6 +89,7 @@ describe "Regexp#match" do
|
|||
|
||||
ruby_version_is ""..."3.0" do
|
||||
it "resets $~ if passed nil" do
|
||||
suppress_warning do
|
||||
# set $~
|
||||
/./.match("a")
|
||||
$~.should be_kind_of(MatchData)
|
||||
|
@ -97,6 +98,7 @@ describe "Regexp#match" do
|
|||
$~.should be_nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ruby_version_is "2.7"..."3.0" do
|
||||
it "warns the deprecation when the given argument is nil" do
|
||||
|
@ -145,9 +147,11 @@ describe "Regexp#match?" do
|
|||
|
||||
ruby_version_is ""..."3.0" do
|
||||
it "returns false when given nil" do
|
||||
suppress_warning do
|
||||
/./.match?(nil).should be_false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ruby_version_is "2.7"..."3.0" do
|
||||
it "warns the deprecation" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue