Sha256: b7aad4d3362c6e9de87a1db1d0bf5c4666bfffb5bb14843159033e04945ac578

Contents?: true

Size: 543 Bytes

Versions: 14

Compression:

Stored size: 543 Bytes

Contents

require_relative '../../test_helper'

class MachineWithOtherStates < StateMachinesTest
  def setup
    @klass = Class.new
    @machine = StateMachines::Machine.new(@klass, initial: :parked)
    @parked, @idling = @machine.other_states(:parked, :idling)
  end

  def test_should_include_other_states_in_known_states
    assert_equal [@parked, @idling], @machine.states.to_a
  end

  def test_should_use_default_value
    assert_equal 'idling', @idling.value
  end

  def test_should_not_create_matcher
    assert_nil @idling.matcher
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

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