зеркало из https://github.com/github/ruby.git
Fix warnings in Regexp#{match,match?} specs
This commit is contained in:
Родитель
fbacfe6820
Коммит
782d1b8fb0
|
@ -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
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче