class StateByDefaultTest

Public Instance Methods

setup() click to toggle source
# File test/unit/state_test.rb, line 4
def setup
  @machine = StateMachine::Machine.new(Class.new)
  @machine.states << @state = StateMachine::State.new(@machine, :parked)
end
test_should_have_a_human_name() click to toggle source
# File test/unit/state_test.rb, line 21
def test_should_have_a_human_name
  assert_equal 'parked', @state.human_name
end
test_should_have_a_machine() click to toggle source
# File test/unit/state_test.rb, line 9
def test_should_have_a_machine
  assert_equal @machine, @state.machine
end
test_should_have_a_name() click to toggle source
# File test/unit/state_test.rb, line 13
def test_should_have_a_name
  assert_equal :parked, @state.name
end
test_should_have_a_qualified_name() click to toggle source
# File test/unit/state_test.rb, line 17
def test_should_have_a_qualified_name
  assert_equal :parked, @state.name
end
test_should_not_be_initial() click to toggle source
# File test/unit/state_test.rb, line 29
def test_should_not_be_initial
  assert !@state.initial
end
test_should_not_have_a_matcher() click to toggle source
# File test/unit/state_test.rb, line 33
def test_should_not_have_a_matcher
  assert_nil @state.matcher
end
test_should_not_have_any_methods() click to toggle source
# File test/unit/state_test.rb, line 37
def test_should_not_have_any_methods
  expected = {}
  assert_equal expected, @state.methods
end
test_should_use_stringify_the_name_as_the_value() click to toggle source
# File test/unit/state_test.rb, line 25
def test_should_use_stringify_the_name_as_the_value
  assert_equal 'parked', @state.value
end