6p6ou6TLu41KriuWAMl3QF changeset

Changeset393538303231 (b)
ParentNone (a)
ab
0+From a3f952616a416480f9f382248c39d0f37b1385b2 Mon Sep 17 00:00:00 2001
0+From: Graham <graham-storm-git@ript.net>
0+Date: Thu, 28 Jan 2010 15:46:33 -0700
0+Subject: [PATCH] Updated spec for issue when raising an object instance with a message
0+
0+---
0+ spec/ruby/language/rescue_spec.rb |   23 +++++++++++++++++++++++
0+ 1 files changed, 23 insertions(+), 0 deletions(-)
0+
0+diff --git a/spec/ruby/language/rescue_spec.rb b/spec/ruby/language/rescue_spec.rb
0+index 2bd01eb..1b1bd11 100644
0+--- a/spec/ruby/language/rescue_spec.rb
0++++ b/spec/ruby/language/rescue_spec.rb
0+@@ -3,6 +3,12 @@ class SpecificExampleException < StandardError
0+ end
0+ class OtherCustomException < StandardError
0+ end
0++class CustomArgumentException < StandardError
0++       attr_reader :val
0++       def initialize(val)
0++               @val = val
0++       end
0++end
0+ 
0+ def exception_list
0+   [SpecificExampleException, ZeroDivisionError]
0+@@ -24,6 +30,23 @@ describe "The rescue keyword" do
0+       e.message.should == "some text"
0+     end
0+   end
0++
0++       it "can take an object instance instead of a class to raise" do
0++               begin
0++                       raise CustomArgumentException.new(1)
0++               rescue CustomArgumentException => e
0++                       e.val.should == 1
0++               end
0++       end
0++       
0++       it "can take an object instance instead of a class to raise as well as a message" do
0++               begin
0++                       raise CustomArgumentException.new(1), "some text"
0++               rescue CustomArgumentException => e
0++                       e.val.should == 1
0++                       e.message.should == "some text"
0++               end
0++       end
0+   
0+   it "can rescue multiple raised exceptions with a single rescue block" do
0+     lambda do
0+--
0+1.6.1.2
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
--- Revision None
+++ Revision 393538303231
@@ -0,0 +1,52 @@
+From a3f952616a416480f9f382248c39d0f37b1385b2 Mon Sep 17 00:00:00 2001
+From: Graham <graham-storm-git@ript.net>
+Date: Thu, 28 Jan 2010 15:46:33 -0700
+Subject: [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.rb
+index 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