class StateWithMatcherTest

Public Instance Methods

setup() click to toggle source
# File test/unit/state_test.rb, line 327
def setup
  @klass = Class.new
  @args = nil
  @machine = StateMachine::Machine.new(@klass)
  @machine.states << @state = StateMachine::State.new(@machine, :parked, :if => lambda {|value| value == 1})
end
test_should_match_evaluated_block() click to toggle source
# File test/unit/state_test.rb, line 338
def test_should_match_evaluated_block
  assert @state.matches?(1)
end
test_should_not_match_actual_value() click to toggle source
# File test/unit/state_test.rb, line 334
def test_should_not_match_actual_value
  assert !@state.matches?('parked')
end