Sha256: fbfcfcf9c0a69381f45b1f4a05148fd8af05d23ea3531f7918ee95dcdfcc86c8

Contents?: true

Size: 752 Bytes

Versions: 14

Compression:

Stored size: 752 Bytes

Contents

require_relative '../../test_helper'

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

  def test_should_not_be_final_with_outgoing_whitelist_transitions
    @machine.event :ignite do
      transition parked: :idling
    end

    refute @state.final?
  end

  def test_should_not_be_final_with_outgoing_all_transitions
    @machine.event :ignite do
      transition all => :idling
    end

    refute @state.final?
  end

  def test_should_not_be_final_with_outgoing_blacklist_transitions
    @machine.event :ignite do
      transition all - :first_gear => :idling
    end

    refute @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_not_final_test.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/state_machines-0.2.2/test/unit/state/state_not_final_test.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/state_machines-0.2.2/test/unit/state/state_not_final_test.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/state_machines-0.2.2/test/unit/state/state_not_final_test.rb
state_machines-0.4.0 test/unit/state/state_not_final_test.rb
state_machines-0.3.0 test/unit/state/state_not_final_test.rb
state_machines-0.2.2 test/unit/state/state_not_final_test.rb
state_machines-0.2.1 test/unit/state/state_not_final_test.rb
state_machines-0.2.0 test/unit/state/state_not_final_test.rb
state_machines-0.1.4 test/unit/state/state_not_final_test.rb
state_machines-0.1.3 test/unit/state/state_not_final_test.rb
state_machines-0.1.2 test/unit/state/state_not_final_test.rb
state_machines-0.1.1 test/unit/state/state_not_final_test.rb
state_machines-0.1.0 test/unit/state/state_not_final_test.rb