mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@7a16e01
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b8e389a0f3
commit
da7976235f
75 changed files with 940 additions and 258 deletions
|
@ -475,6 +475,24 @@ describe "Marshal.dump" do
|
|||
obj.set_backtrace(["foo/bar.rb:10"])
|
||||
Marshal.dump(obj).should == "\x04\bo:\x0EException\a:\tmesg\"\bfoo:\abt[\x06\"\x12foo/bar.rb:10"
|
||||
end
|
||||
|
||||
it "dumps the cause for the exception" do
|
||||
exc = nil
|
||||
begin
|
||||
raise StandardError, "the cause"
|
||||
rescue StandardError => cause
|
||||
begin
|
||||
raise RuntimeError, "the consequence"
|
||||
rescue RuntimeError => e
|
||||
e.cause.should equal(cause)
|
||||
exc = e
|
||||
end
|
||||
end
|
||||
|
||||
reloaded = Marshal.load(Marshal.dump(exc))
|
||||
reloaded.cause.should be_an_instance_of(StandardError)
|
||||
reloaded.cause.message.should == "the cause"
|
||||
end
|
||||
end
|
||||
|
||||
it "dumps subsequent appearances of a symbol as a link" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue