Sha256: 8d534344a7a0d6090eba16a3d2c1c4704debf6d99f40c7a12a17a489a780cd69
Contents?: true
Size: 484 Bytes
Versions: 6
Compression:
Stored size: 484 Bytes
Contents
class SpecificExampleException < StandardError; end class OtherCustomException < StandardError; end def exception_list [SpecificExampleException, OtherCustomException] end describe "The rescue keyword" do it "can be used to handle a specific exception" it "can capture the raised exception in a local variable" do begin raise SpecificExampleException, "some text" rescue SpecificExampleException => e e.message.should == "some text" end end end
Version data entries
6 entries across 6 versions & 1 rubygems