Skip to content

Commit

Permalink
Disable spec of pattern matching is experimental since 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
znz committed Jul 17, 2021
1 parent 2a5b5ff commit f11f9fc
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions spec/ruby/language/pattern_matching_spec.rb
Expand Up @@ -41,24 +41,26 @@
end

describe "warning" do
before :each do
ruby_version_is ""..."3.0" do
@src = 'case [0, 1]; in [a, b]; end'
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
ruby_version_is "3.0" do
@src = '[0, 1] => [a, b]'
end

@experimental, Warning[:experimental] = Warning[:experimental], true
end
@experimental, Warning[:experimental] = Warning[:experimental], true
end

after :each do
Warning[:experimental] = @experimental
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

Expand Down

0 comments on commit f11f9fc

Please sign in to comment.