diff --git a/lib/aasm/aasm.rb b/lib/aasm/aasm.rb index 3e2aeb5c..85252b03 100644 --- a/lib/aasm/aasm.rb +++ b/lib/aasm/aasm.rb @@ -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 diff --git a/spec/unit/aasm_spec.rb b/spec/unit/aasm_spec.rb index 585aba2f..f486162f 100644 --- a/spec/unit/aasm_spec.rb +++ b/spec/unit/aasm_spec.rb @@ -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