class MachineCollectionTransitionsWithExisitingTransitionsTest
Public Instance Methods
setup()
click to toggle source
# File test/unit/machine_collection_test.rb, line 506 def setup @klass = Class.new @machines = StateMachine::MachineCollection.new @machines[:state] = @machine = StateMachine::Machine.new(@klass, :state, :initial => :parked, :action => :save) @machine.event :ignite do transition :parked => :idling end @object = @klass.new @object.send(:state_event_transition=, StateMachine::Transition.new(@object, @machine, :ignite, :parked, :idling)) @transitions = @machines.transitions(@object, :save) end
test_should_not_be_empty()
click to toggle source
# File test/unit/machine_collection_test.rb, line 520 def test_should_not_be_empty assert_equal 1, @transitions.length end
test_should_perform()
click to toggle source
# File test/unit/machine_collection_test.rb, line 524 def test_should_perform assert_equal true, @transitions.perform end