Sha256: c0d9fe7be620e593f7e8c8f75571dca3b17c38d026b0075683af1b05e4094325

Contents?: true

Size: 690 Bytes

Versions: 14

Compression:

Stored size: 690 Bytes

Contents

require_relative '../../test_helper'

class MachineCollectionTransitionsWithoutTransitionTest < StateMachinesTest
  def setup
    @klass = Class.new

    @machines = StateMachines::MachineCollection.new
    @machines[:state] = @machine = StateMachines::Machine.new(@klass, :state, initial: :parked, action: :save)
    @machine.event :ignite do
      transition parked: :idling
    end

    @object = @klass.new
    @object.state = 'idling'
    @object.state_event = 'ignite'
    @transitions = @machines.transitions(@object, :save)
  end

  def test_should_be_empty
    assert @transitions.empty?
  end

  def test_should_not_perform
    assert_equal false, @transitions.perform
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

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