1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Disable spec of pattern matching is experimental since 3.1

This commit is contained in:
Kazuhiro NISHIYAMA 2021-07-17 13:24:23 +09:00
parent 2a5b5ff49a
commit f11f9fc921
No known key found for this signature in database
GPG key ID: 262ED8DBB4222F7A

View file

@ -41,24 +41,26 @@ ruby_version_is "2.7" do
end
describe "warning" do
before :each do
ruby_version_is ""..."3.0" do
@src = 'case [0, 1]; in [a, b]; end'
ruby_version_is ""..."3.1" do
before :each do
ruby_version_is ""..."3.0" do
@src = 'case [0, 1]; in [a, b]; end'
end
ruby_version_is "3.0" do
@src = '[0, 1] => [a, b]'
end
@experimental, Warning[:experimental] = Warning[:experimental], true
end
ruby_version_is "3.0" do
@src = '[0, 1] => [a, b]'
after :each do
Warning[:experimental] = @experimental
end
@experimental, Warning[:experimental] = Warning[:experimental], true
end
after :each do
Warning[:experimental] = @experimental
end
it "warns about pattern matching is experimental feature" do
-> { eval @src }.should complain(/pattern matching is experimental, and the behavior may change in future versions of Ruby!/i)
it "warns about pattern matching is experimental feature" do
-> { eval @src }.should complain(/pattern matching is experimental, and the behavior may change in future versions of Ruby!/i)
end
end
end