summaryrefslogtreecommitdiff
path: root/spec/ruby/language/rescue_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/language/rescue_spec.rb')
-rw-r--r--spec/ruby/language/rescue_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/ruby/language/rescue_spec.rb b/spec/ruby/language/rescue_spec.rb
index 4d164b38c6..fcd9ae0de9 100644
--- a/spec/ruby/language/rescue_spec.rb
+++ b/spec/ruby/language/rescue_spec.rb
@@ -115,6 +115,18 @@ describe "The rescue keyword" do
end
end
+ it "converts the splatted list of exceptions using #to_a" do
+ exceptions = mock("to_a")
+ exceptions.should_receive(:to_a).and_return(exception_list)
+ caught_it = false
+ begin
+ raise SpecificExampleException, "not important"
+ rescue *exceptions
+ caught_it = true
+ end
+ caught_it.should be_true
+ end
+
it "can combine a splatted list of exceptions with a literal list of exceptions" do
caught_it = false
begin