Sha256: 4cdcbc94c6c6474defe746c5bf5dcecaff26baeb10d9c6174ca0eaaa9ddf9b4b

Contents?: true

Size: 938 Bytes

Versions: 13

Compression:

Stored size: 938 Bytes

Contents

require_relative '../test_helper'
require_relative '../files/models/motorcycle'

class MotorcycleTest < MiniTest::Test
  def setup
    @motorcycle = Motorcycle.new
  end

  def test_should_be_in_idling_state
    assert_equal 'idling', @motorcycle.state
  end

  def test_should_allow_park
    assert @motorcycle.park
  end

  def test_should_not_allow_ignite
    refute @motorcycle.ignite
  end

  def test_should_allow_shift_up
    assert @motorcycle.shift_up
  end

  def test_should_not_allow_shift_down
    refute @motorcycle.shift_down
  end

  def test_should_not_allow_crash
    refute @motorcycle.crash
  end

  def test_should_not_allow_repair
    refute @motorcycle.repair
  end

  def test_should_inherit_decibels_from_superclass
    @motorcycle.park
    assert_equal 0.0, @motorcycle.decibels
  end

  def test_should_use_decibels_defined_in_state
    @motorcycle.shift_up
    assert_equal 1.0, @motorcycle.decibels
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
solidus_backend-1.0.0.pre3 vendor/bundle/gems/state_machines-0.2.2/test/functional/motorcycle_test.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/state_machines-0.2.2/test/functional/motorcycle_test.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/state_machines-0.2.2/test/functional/motorcycle_test.rb
state_machines-0.4.0 test/functional/motorcycle_test.rb
state_machines-0.3.0 test/functional/motorcycle_test.rb
state_machines-0.2.2 test/functional/motorcycle_test.rb
state_machines-0.2.1 test/functional/motorcycle_test.rb
state_machines-0.2.0 test/functional/motorcycle_test.rb
state_machines-0.1.4 test/functional/motorcycle_test.rb
state_machines-0.1.3 test/functional/motorcycle_test.rb
state_machines-0.1.2 test/functional/motorcycle_test.rb
state_machines-0.1.1 test/functional/motorcycle_test.rb
state_machines-0.1.0 test/functional/motorcycle_test.rb