No title Revision 393538303231 (Thu Jan 28 2010 at 22:50) - Diff Link to this snippet: https://friendpaste.com/6p6ou6TLu41KriuWAMl3QF Embed: manni perldoc borland colorful default murphy trac fruity autumn bw emacs pastie friendly Show line numbers Wrap lines 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152From a3f952616a416480f9f382248c39d0f37b1385b2 Mon Sep 17 00:00:00 2001From: Graham <graham-storm-git@ript.net>Date: Thu, 28 Jan 2010 15:46:33 -0700Subject: [PATCH] Updated spec for issue when raising an object instance with a message--- spec/ruby/language/rescue_spec.rb | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-)diff --git a/spec/ruby/language/rescue_spec.rb b/spec/ruby/language/rescue_spec.rbindex 2bd01eb..1b1bd11 100644--- a/spec/ruby/language/rescue_spec.rb+++ b/spec/ruby/language/rescue_spec.rb@@ -3,6 +3,12 @@ class SpecificExampleException < StandardError end class OtherCustomException < StandardError end+class CustomArgumentException < StandardError+ attr_reader :val+ def initialize(val)+ @val = val+ end+end def exception_list [SpecificExampleException, ZeroDivisionError]@@ -24,6 +30,23 @@ describe "The rescue keyword" do e.message.should == "some text" end end++ it "can take an object instance instead of a class to raise" do+ begin+ raise CustomArgumentException.new(1)+ rescue CustomArgumentException => e+ e.val.should == 1+ end+ end+ + it "can take an object instance instead of a class to raise as well as a message" do+ begin+ raise CustomArgumentException.new(1), "some text"+ rescue CustomArgumentException => e+ e.val.should == 1+ e.message.should == "some text"+ end+ end it "can rescue multiple raised exceptions with a single rescue block" do lambda do-- 1.6.1.2