mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
Fixed an typo
This commit is contained in:
parent
69a501d1bf
commit
3cac5eb23d
2 changed files with 3 additions and 3 deletions
|
@ -193,7 +193,7 @@ module AASM
|
|||
false
|
||||
end
|
||||
rescue => e
|
||||
if self.responds_to?(:aasm_error_callback)
|
||||
if self.respond_to?(:aasm_error_callback)
|
||||
self.aasm_error_callback(e)
|
||||
else
|
||||
raise e
|
||||
|
|
|
@ -295,14 +295,14 @@ describe AASM, '- event callbacks' do
|
|||
|
||||
it "should run aasm_error_callback if an exception is raised" do
|
||||
@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.close!
|
||||
end
|
||||
|
||||
it "should propograte an exception if aasm_error_callback is not defined" do
|
||||
@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)
|
||||
lambda{@foo.close!}.should raise_error
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue