spec/lib/traits/damaging_spec.rb in gosu_extensions-0.1.11 vs spec/lib/traits/damaging_spec.rb in gosu_extensions-0.1.12
- old
+ new
@@ -31,8 +31,20 @@
@damaging_class = test_class_with Damaging
end
it "should raise a DamageMissingError" do
lambda { @damaging_class.new(@window) }.should raise_error(Damaging::DamageMissingError)
end
+ it "should raise with the right message" do
+ lambda { @damaging_class.new(@window) }.should raise_error(Damaging::DamageMissingError, <<-MESSAGE
+ In a Damaging thing, you need to define method
+ damage damage = nil, &block
+ with params
+ damage 13 # some value
+ or
+ damage { 13 + rand(7) } # some block
+ to define how much damage the thing does.
+ MESSAGE
+ )
+ end
end
end
\ No newline at end of file