class VehicleParkedTest

Public Instance Methods

setup() click to toggle source
# File test/functional/state_machine_test.rb, line 422
def setup
  @vehicle = Vehicle.new
end
test_should_allow_ignite() click to toggle source
# File test/functional/state_machine_test.rb, line 438
def test_should_allow_ignite
  assert @vehicle.ignite
  assert_equal 'idling', @vehicle.state
end
test_should_be_in_parked_state() click to toggle source
# File test/functional/state_machine_test.rb, line 426
def test_should_be_in_parked_state
  assert_equal 'parked', @vehicle.state
end
test_should_not_allow_crash() click to toggle source
# File test/functional/state_machine_test.rb, line 455
def test_should_not_allow_crash
  assert !@vehicle.crash
end
test_should_not_allow_idle() click to toggle source
# File test/functional/state_machine_test.rb, line 443
def test_should_not_allow_idle
  assert !@vehicle.idle
end
test_should_not_allow_park() click to toggle source
# File test/functional/state_machine_test.rb, line 434
def test_should_not_allow_park
  assert !@vehicle.park
end
test_should_not_allow_repair() click to toggle source
# File test/functional/state_machine_test.rb, line 459
def test_should_not_allow_repair
  assert !@vehicle.repair
end
test_should_not_allow_shift_down() click to toggle source
# File test/functional/state_machine_test.rb, line 451
def test_should_not_allow_shift_down
  assert !@vehicle.shift_down
end
test_should_not_allow_shift_up() click to toggle source
# File test/functional/state_machine_test.rb, line 447
def test_should_not_allow_shift_up
  assert !@vehicle.shift_up
end
test_should_not_have_the_seatbelt_on() click to toggle source
# File test/functional/state_machine_test.rb, line 430
def test_should_not_have_the_seatbelt_on
  assert !@vehicle.seatbelt_on
end
test_should_raise_exception_if_repair_not_allowed!() click to toggle source
# File test/functional/state_machine_test.rb, line 463
def test_should_raise_exception_if_repair_not_allowed!
  exception = assert_raise(StateMachine::InvalidTransition) {@vehicle.repair!}
  assert_equal @vehicle, exception.object
  assert_equal Vehicle.state_machine(:state), exception.machine
  assert_equal :repair, exception.event
  assert_equal 'parked', exception.from
end