class TransitionWithInvalidNodesTest

Public Instance Methods

setup() click to toggle source
# File test/unit/transition_test.rb, line 99
def setup
  @klass = Class.new
  @machine = StateMachine::Machine.new(@klass)
  @machine.state :parked, :idling
  @machine.event :ignite
  
  @object = @klass.new
  @object.state = 'parked'
end
test_should_raise_exception_with_invalid_event() click to toggle source
# File test/unit/transition_test.rb, line 113
def test_should_raise_exception_with_invalid_event
  assert_raise(IndexError) { StateMachine::Transition.new(@object, @machine, :invalid, :parked, :idling) }
end
test_should_raise_exception_with_invalid_from_state() click to toggle source
# File test/unit/transition_test.rb, line 117
def test_should_raise_exception_with_invalid_from_state
  assert_raise(IndexError) { StateMachine::Transition.new(@object, @machine, :ignite, :invalid, :idling) }
end
test_should_raise_exception_with_invalid_to_state() click to toggle source
# File test/unit/transition_test.rb, line 121
def test_should_raise_exception_with_invalid_to_state
  assert_raise(IndexError) { StateMachine::Transition.new(@object, @machine, :ignite, :parked, :invalid) }
end
test_should_raise_exception_without_event() click to toggle source
# File test/unit/transition_test.rb, line 109
def test_should_raise_exception_without_event
  assert_raise(IndexError) { StateMachine::Transition.new(@object, @machine, nil, :parked, :idling) }
end