class PathCollectionWithFromStateTest

Public Instance Methods

setup() click to toggle source
# File test/unit/path_collection_test.rb, line 173
def setup
  @klass = Class.new
  @machine = StateMachine::Machine.new(@klass)
  @machine.state :parked, :idling, :first_gear
  @machine.event :park do
    transition :idling => :parked
  end
  
  @object = @klass.new
  @object.state = 'parked'
  
  @paths = StateMachine::PathCollection.new(@object, @machine, :from => :idling)
end
test_should_generate_paths_from_custom_from_state() click to toggle source
# File test/unit/path_collection_test.rb, line 187
def test_should_generate_paths_from_custom_from_state
  assert_equal [[
    StateMachine::Transition.new(@object, @machine, :park, :idling, :parked)
  ]], @paths
end
test_should_have_a_from_name() click to toggle source
# File test/unit/path_collection_test.rb, line 193
def test_should_have_a_from_name
  assert_equal :idling, @paths.from_name
end