class PathByDefaultTest

Public Instance Methods

setup() click to toggle source
# File test/unit/path_test.rb, line 4
def setup
  @klass = Class.new
  @machine = StateMachine::Machine.new(@klass)
  @object = @klass.new
  
  @path = StateMachine::Path.new(@object, @machine)
end
test_should_have_a_machine() click to toggle source
# File test/unit/path_test.rb, line 16
def test_should_have_a_machine
  assert_equal @machine, @path.machine
end
test_should_have_an_object() click to toggle source
# File test/unit/path_test.rb, line 12
def test_should_have_an_object
  assert_equal @object, @path.object
end
test_should_have_no_events() click to toggle source
# File test/unit/path_test.rb, line 40
def test_should_have_no_events
  assert_equal [], @path.events
end
test_should_have_no_from_states() click to toggle source
# File test/unit/path_test.rb, line 28
def test_should_have_no_from_states
  assert_equal [], @path.from_states
end
test_should_have_no_to_states() click to toggle source
# File test/unit/path_test.rb, line 36
def test_should_have_no_to_states
  assert_equal [], @path.to_states
end
test_should_not_be_able_to_walk_anywhere() click to toggle source
# File test/unit/path_test.rb, line 44
def test_should_not_be_able_to_walk_anywhere
  walked = false
  @path.walk { walked = true }
  assert_equal false, walked
end
test_should_not_be_complete() click to toggle source
# File test/unit/path_test.rb, line 50
def test_should_not_be_complete
  assert_equal false, @path.complete?
end
test_should_not_have_a_from_name() click to toggle source
# File test/unit/path_test.rb, line 24
def test_should_not_have_a_from_name
  assert_nil @path.from_name
end
test_should_not_have_a_to_name() click to toggle source
# File test/unit/path_test.rb, line 32
def test_should_not_have_a_to_name
  assert_nil @path.to_name
end
test_should_not_have_walked_anywhere() click to toggle source
# File test/unit/path_test.rb, line 20
def test_should_not_have_walked_anywhere
  assert_equal [], @path
end