mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@e57f49c
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a53ee2136f
commit
42921458ff
11 changed files with 127 additions and 15 deletions
|
@ -66,6 +66,22 @@ describe "Exception#exception" do
|
|||
e2.message.should == "message"
|
||||
end
|
||||
|
||||
it "when raised will be rescued as the new exception" do
|
||||
begin
|
||||
begin
|
||||
raised_first = StandardError.new('first')
|
||||
raise raised_first
|
||||
rescue => caught_first
|
||||
raised_second = raised_first.exception('second')
|
||||
raise raised_second
|
||||
end
|
||||
rescue => caught_second
|
||||
end
|
||||
|
||||
raised_first.should == caught_first
|
||||
raised_second.should == caught_second
|
||||
end
|
||||
|
||||
class CustomArgumentError < StandardError
|
||||
attr_reader :val
|
||||
def initialize(val)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue