class PathCollectionWithDuplicateNodesTest

Public Instance Methods

setup() click to toggle source
# File test/unit/path_collection_test.rb, line 143
def setup
  @klass = Class.new
  @machine = StateMachine::Machine.new(@klass)
  @machine.state :parked, :idling
  @machine.event :shift_up do
    transition :parked => :idling, :idling => :first_gear
  end
  @machine.event :park do
    transition :first_gear => :idling
  end
  @object = @klass.new
  @object.state = 'parked'
  
  @paths = StateMachine::PathCollection.new(@object, @machine)
end
test_should_not_include_duplicates_in_events() click to toggle source
# File test/unit/path_collection_test.rb, line 167
def test_should_not_include_duplicates_in_events
  assert_equal [:shift_up, :park], @paths.events
end
test_should_not_include_duplicates_in_from_states() click to toggle source
# File test/unit/path_collection_test.rb, line 159
def test_should_not_include_duplicates_in_from_states
  assert_equal [:parked, :idling, :first_gear], @paths.from_states
end
test_should_not_include_duplicates_in_to_states() click to toggle source
# File test/unit/path_collection_test.rb, line 163
def test_should_not_include_duplicates_in_to_states
  assert_equal [:idling, :first_gear], @paths.to_states
end