summaryrefslogtreecommitdiff
path: root/spec/ruby/language/rescue_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2019-04-27 18:53:23 +0200
committerBenoit Daloze <eregontp@gmail.com>2019-04-27 18:53:23 +0200
commita1b4816759418ca8fe510e8739622fc5d77ab0f0 (patch)
tree9d4fb6091d0086817f5bde46bf1150e9130d34fd /spec/ruby/language/rescue_spec.rb
parent00c33d9c232ed1a79eda17acd7231ac93caa162b (diff)
Update to ruby/spec@15c9619
Diffstat (limited to 'spec/ruby/language/rescue_spec.rb')
-rw-r--r--spec/ruby/language/rescue_spec.rb20
1 files changed, 6 insertions, 14 deletions
diff --git a/spec/ruby/language/rescue_spec.rb b/spec/ruby/language/rescue_spec.rb
index 7df8b6db90..b0eb949c1a 100644
--- a/spec/ruby/language/rescue_spec.rb
+++ b/spec/ruby/language/rescue_spec.rb
@@ -449,22 +449,14 @@ describe "The rescue keyword" do
end
end
- ruby_version_is ""..."2.4" do
- it "fails when using 'rescue' in method arguments" do
- lambda { eval '1.+ (1 rescue 1)' }.should raise_error(SyntaxError)
- end
+ it "allows 'rescue' in method arguments" do
+ two = eval '1.+ (raise("Error") rescue 1)'
+ two.should == 2
end
- ruby_version_is "2.4" do
- it "allows 'rescue' in method arguments" do
- two = eval '1.+ (raise("Error") rescue 1)'
- two.should == 2
- end
-
- it "requires the 'rescue' in method arguments to be wrapped in parens" do
- lambda { eval '1.+(1 rescue 1)' }.should raise_error(SyntaxError)
- eval('1.+((1 rescue 1))').should == 2
- end
+ it "requires the 'rescue' in method arguments to be wrapped in parens" do
+ lambda { eval '1.+(1 rescue 1)' }.should raise_error(SyntaxError)
+ eval('1.+((1 rescue 1))').should == 2
end
describe "inline form" do