Permalink
Browse files

Updated spec for issue when raising an object instance with a message

  • Loading branch information...
stormbrew authored and Evan Phoenix committed Jan 28, 2010
1 parent 7fe1be7 commit aa321d1ef8fd032885695e4cb0a79283a5c8faed
Showing with 14 additions and 0 deletions.
  1. +14 −0 spec/ruby/core/exception/exception_spec.rb
@@ -68,4 +68,18 @@
e2.message.should == :message
end
class CustomArgumentError < StandardError
attr_reader :val
def initialize(val)
@val = val
end
end
it "returns an exception of the same class as self with the message given as argument, but without reinitializing" do
e = CustomArgumentError.new(:boom)
e2 = e.exception(:message)
e2.should be_an_instance_of(CustomArgumentError)
e2.val.should == :boom
e2.message.should == :message
end
end

0 comments on commit aa321d1

Please sign in to comment.