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:
parent
2a5b5ff49a
commit
f11f9fc921
1 changed files with 16 additions and 14 deletions
|
@ -41,24 +41,26 @@ ruby_version_is "2.7" do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "warning" do
|
describe "warning" do
|
||||||
before :each do
|
ruby_version_is ""..."3.1" do
|
||||||
ruby_version_is ""..."3.0" do
|
before :each do
|
||||||
@src = 'case [0, 1]; in [a, b]; end'
|
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
|
end
|
||||||
|
|
||||||
ruby_version_is "3.0" do
|
after :each do
|
||||||
@src = '[0, 1] => [a, b]'
|
Warning[:experimental] = @experimental
|
||||||
end
|
end
|
||||||
|
|
||||||
@experimental, Warning[:experimental] = Warning[:experimental], true
|
it "warns about pattern matching is experimental feature" do
|
||||||
end
|
-> { eval @src }.should complain(/pattern matching is experimental, and the behavior may change in future versions of Ruby!/i)
|
||||||
|
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)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue