class StateCollectionWithNamespaceTest

Public Instance Methods

setup() click to toggle source
# File test/unit/state_collection_test.rb, line 92
def setup
  @klass = Class.new
  @machine = StateMachine::Machine.new(@klass, :namespace => 'vehicle')
  @states = StateMachine::StateCollection.new(@machine)
  
  @states << @state = StateMachine::State.new(@machine, :parked)
  @machine.states.concat(@states)
end
test_should_index_by_name() click to toggle source
# File test/unit/state_collection_test.rb, line 101
def test_should_index_by_name
  assert_equal @state, @states[:parked, :name]
end
test_should_index_by_qualified_name() click to toggle source
# File test/unit/state_collection_test.rb, line 105
def test_should_index_by_qualified_name
  assert_equal @state, @states[:vehicle_parked, :qualified_name]
end