Sha256: ae5da64b58609ef795db9a05e32b61d20f191ec27f578f2dc2584f8384d44ead

Contents?: true

Size: 609 Bytes

Versions: 14

Compression:

Stored size: 609 Bytes

Contents

require_relative '../../test_helper'

class StateFinalTest < StateMachinesTest
  def setup
    @machine = StateMachines::Machine.new(Class.new)
    @machine.states << @state = StateMachines::State.new(@machine, :parked)
  end

  def test_should_be_final_without_input_transitions
    assert @state.final?
  end

  def test_should_be_final_with_input_transitions
    @machine.event :park do
      transition idling: :parked
    end

    assert @state.final?
  end

  def test_should_be_final_with_loopback
    @machine.event :ignite do
      transition parked: same
    end

    assert @state.final?
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

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