class PathCollectionByDefaultTest

Public Instance Methods

setup() click to toggle source
# File test/unit/path_collection_test.rb, line 4
def setup
  @klass = Class.new
  @machine = StateMachine::Machine.new(@klass)
  @machine.state :parked
  
  @object = @klass.new
  @object.state = 'parked'
  
  @paths = StateMachine::PathCollection.new(@object, @machine)
end
test_should_have_a_from_name() click to toggle source
# File test/unit/path_collection_test.rb, line 23
def test_should_have_a_from_name
  assert_equal :parked, @paths.from_name
end
test_should_have_a_machine() click to toggle source
# File test/unit/path_collection_test.rb, line 19
def test_should_have_a_machine
  assert_equal @machine, @paths.machine
end
test_should_have_an_object() click to toggle source
# File test/unit/path_collection_test.rb, line 15
def test_should_have_an_object
  assert_equal @object, @paths.object
end
test_should_have_no_events() click to toggle source
# File test/unit/path_collection_test.rb, line 39
def test_should_have_no_events
  assert_equal [], @paths.events
end
test_should_have_no_from_states() click to toggle source
# File test/unit/path_collection_test.rb, line 31
def test_should_have_no_from_states
  assert_equal [], @paths.from_states
end
test_should_have_no_paths() click to toggle source
# File test/unit/path_collection_test.rb, line 43
def test_should_have_no_paths
  assert @paths.empty?
end
test_should_have_no_to_states() click to toggle source
# File test/unit/path_collection_test.rb, line 35
def test_should_have_no_to_states
  assert_equal [], @paths.to_states
end
test_should_not_have_a_to_name() click to toggle source
# File test/unit/path_collection_test.rb, line 27
def test_should_not_have_a_to_name
  assert_nil @paths.to_name
end