class StateWithSymbolicValueTest
Public Instance Methods
setup()
click to toggle source
# File test/unit/state_test.rb, line 187 def setup @klass = Class.new @machine = StateMachine::Machine.new(@klass) @machine.states << @state = StateMachine::State.new(@machine, :parked, :value => :parked) end
test_should_define_predicate()
click to toggle source
# File test/unit/state_test.rb, line 206 def test_should_define_predicate object = @klass.new assert object.respond_to?(:parked?) end
test_should_match_symbolic_value()
click to toggle source
# File test/unit/state_test.rb, line 201 def test_should_match_symbolic_value assert @state.matches?(:parked) assert !@state.matches?('parked') end
test_should_not_include_value_in_description()
click to toggle source
# File test/unit/state_test.rb, line 197 def test_should_not_include_value_in_description assert_equal 'parked', @state.description end
test_should_use_custom_value()
click to toggle source
# File test/unit/state_test.rb, line 193 def test_should_use_custom_value assert_equal :parked, @state.value end