Sha256: d35f6ccad36188d76cf965b25e6b64eb9a53cf0df7815020023a5e6381a52a68
Contents?: true
Size: 770 Bytes
Versions: 14
Compression:
Stored size: 770 Bytes
Contents
require_relative '../../test_helper' class PathWithGuardedPathsTest < StateMachinesTest def setup @klass = Class.new @machine = StateMachines::Machine.new(@klass) @machine.state :parked, :idling, :first_gear @machine.event :ignite do transition parked: :idling, if: lambda { false } end @object = @klass.new @object.state = 'parked' end def test_should_not_enumerate_paths_if_guard_enabled assert_equal [], StateMachines::PathCollection.new(@object, @machine) end def test_should_enumerate_paths_if_guard_disabled paths = StateMachines::PathCollection.new(@object, @machine, guard: false) assert_equal [[ StateMachines::Transition.new(@object, @machine, :ignite, :parked, :idling) ]], paths end end
Version data entries
14 entries across 14 versions & 2 rubygems