From cd4f9146aaae5e7f7dab2235afbd36f20e8dcc94 Mon Sep 17 00:00:00 2001 From: Scott Barron Date: Wed, 13 Aug 2008 17:56:16 -0400 Subject: [PATCH] This spec wasn't really working right. --- spec/unit/event_spec.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spec/unit/event_spec.rb b/spec/unit/event_spec.rb index c7c2001..d490699 100644 --- a/spec/unit/event_spec.rb +++ b/spec/unit/event_spec.rb @@ -31,9 +31,11 @@ end describe AASM::SupportingClasses::Event, 'when firing an event' do it 'should raise an AASM::InvalidTransition error if the transitions are empty' do - event = AASM::SupportingClasses::Event.new(:event) + obj = mock('object') + obj.stub!(:aasm_current_state) - lambda { event.fire(nil) }.should raise_error(AASM::InvalidTransition) + event = AASM::SupportingClasses::Event.new(:event) + lambda { event.fire(obj) }.should raise_error(AASM::InvalidTransition) end it 'should return the state of the first matching transition it finds' do