1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00

Fixed an typo

This commit is contained in:
Wildfalcon 2009-12-01 10:36:28 +00:00
parent 69a501d1bf
commit 3cac5eb23d
2 changed files with 3 additions and 3 deletions

View file

@ -193,7 +193,7 @@ module AASM
false false
end end
rescue => e rescue => e
if self.responds_to?(:aasm_error_callback) if self.respond_to?(:aasm_error_callback)
self.aasm_error_callback(e) self.aasm_error_callback(e)
else else
raise e raise e

View file

@ -295,14 +295,14 @@ describe AASM, '- event callbacks' do
it "should run aasm_error_callback if an exception is raised" do it "should run aasm_error_callback if an exception is raised" do
@foo.stub!(:enter).and_raise(StandardError) @foo.stub!(:enter).and_raise(StandardError)
@foo.stub!(:responds_to?).with(:aasm_error_callback).and_return(true) @foo.stub!(:respond_to?).with(:aasm_error_callback).and_return(true)
@foo.should_receive(:aasm_error_callback) @foo.should_receive(:aasm_error_callback)
@foo.close! @foo.close!
end end
it "should propograte an exception if aasm_error_callback is not defined" do it "should propograte an exception if aasm_error_callback is not defined" do
@foo.stub!(:enter).and_raise(StandardError) @foo.stub!(:enter).and_raise(StandardError)
@foo.stub!(:responds_to?).with(:aasm_error_callback).and_return(false) @foo.stub!(:respond_to?).with(:aasm_error_callback).and_return(false)
@foo.should_not_receive(:aasm_error_callback) @foo.should_not_receive(:aasm_error_callback)
lambda{@foo.close!}.should raise_error lambda{@foo.close!}.should raise_error
end end