class StateWithoutNameTest

Public Instance Methods

setup() click to toggle source
# File test/unit/state_test.rb, line 87
def setup
  @klass = Class.new
  @machine = StateMachine::Machine.new(@klass)
  @machine.states << @state = StateMachine::State.new(@machine, nil)
end
test_should_have_a_description() click to toggle source
# File test/unit/state_test.rb, line 115
def test_should_have_a_description
  assert_equal 'nil', @state.description
end
test_should_have_a_nil_name() click to toggle source
# File test/unit/state_test.rb, line 93
def test_should_have_a_nil_name
  assert_nil @state.name
end
test_should_have_a_nil_qualified_name() click to toggle source
# File test/unit/state_test.rb, line 97
def test_should_have_a_nil_qualified_name
  assert_nil @state.qualified_name
end
test_should_have_a_nil_value() click to toggle source
# File test/unit/state_test.rb, line 105
def test_should_have_a_nil_value
  assert_nil @state.value
end
test_should_have_an_empty_human_name() click to toggle source
# File test/unit/state_test.rb, line 101
def test_should_have_an_empty_human_name
  assert_equal 'nil', @state.human_name
end
test_should_not_redefine_nil_predicate() click to toggle source
# File test/unit/state_test.rb, line 109
def test_should_not_redefine_nil_predicate
  object = @klass.new
  assert !object.nil?
  assert !object.respond_to?('?')
end