Sha256: c0119e612d142427c42ffada3f578795cd1cb6d322fa84cc11e5f8d3c6c04454
Contents?: true
Size: 760 Bytes
Versions: 14
Compression:
Stored size: 760 Bytes
Contents
require_relative '../../test_helper' class MachineCollectionTransitionsWithExisitingTransitionsTest < StateMachinesTest def setup @klass = Class.new @machines = StateMachines::MachineCollection.new @machines[:state] = @machine = StateMachines::Machine.new(@klass, :state, initial: :parked, action: :save) @machine.event :ignite do transition parked: :idling end @object = @klass.new @object.send(:state_event_transition=, StateMachines::Transition.new(@object, @machine, :ignite, :parked, :idling)) @transitions = @machines.transitions(@object, :save) end def test_should_not_be_empty assert_equal 1, @transitions.length end def test_should_perform assert_equal true, @transitions.perform end end
Version data entries
14 entries across 14 versions & 2 rubygems