Sha256: 1f6402c3ded7944b59c25f3a92ad6ae42b906f6f250e3fffa87bc336fb0b4681
Contents?: true
Size: 615 Bytes
Versions: 29
Compression:
Stored size: 615 Bytes
Contents
require 'spec_helper' class RescueReturningSpec def single begin raise "ERROR" rescue :foo end end def multiple begin raise "ERROR" rescue to_s :bar end end def empty_rescue begin raise "ERROR" rescue end end end describe "The rescue keyword" do it "returns last value of expression evaluated" do RescueReturningSpec.new.single.should == :foo RescueReturningSpec.new.multiple.should == :bar end it "returns nil if no expr given in rescue body" do RescueReturningSpec.new.empty_rescue.should be_nil end end
Version data entries
29 entries across 29 versions & 3 rubygems