Skip to content

Commit

Permalink
Fixed an typo
Browse files Browse the repository at this point in the history
  • Loading branch information
wildfalcon committed Dec 1, 2009
1 parent 69a501d commit 3cac5eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/aasm/aasm.rb
Expand Up @@ -193,7 +193,7 @@ def aasm_fire_event(name, persist, *args)
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
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/aasm_spec.rb
Expand Up @@ -295,14 +295,14 @@ def @foo.aasm_event_fired(event, from, to)

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
Expand Down

0 comments on commit 3cac5eb

Please sign in to comment.