Sha256: ce401d59dc9bbd712f57432ae8ee2fdace65fe475830ce136621baf638d89bef

Contents?: true

Size: 534 Bytes

Versions: 27

Compression:

Stored size: 534 Bytes

Contents

require_relative '../../test_helper'

class BranchWithMultipleExceptToRequirementsTest < StateMachinesTest
  def setup
    @object = Object.new
    @branch = StateMachines::Branch.new(except_to: [:idling, :parked])
  end

  def test_should_match_if_not_included
    assert @branch.matches?(@object, to: :first_gear)
  end

  def test_should_not_match_if_included
    refute @branch.matches?(@object, to: :idling)
  end

  def test_should_be_included_in_known_states
    assert_equal [:idling, :parked], @branch.known_states
  end
end

Version data entries

27 entries across 14 versions & 2 rubygems

Version Path
state_machines-0.5.0 test/unit/branch/branch_with_multiple_except_to_requirements_test.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/state_machines-0.2.2/test/unit/branch/branch_with_multiple_on_requirements_test.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/state_machines-0.2.2/test/unit/branch/branch_with_multiple_except_to_requirements_test.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/state_machines-0.2.2/test/unit/branch/branch_with_multiple_on_requirements_test.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/state_machines-0.2.2/test/unit/branch/branch_with_multiple_except_to_requirements_test.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/state_machines-0.2.2/test/unit/branch/branch_with_multiple_except_to_requirements_test.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/state_machines-0.2.2/test/unit/branch/branch_with_multiple_on_requirements_test.rb
state_machines-0.4.0 test/unit/branch/branch_with_multiple_on_requirements_test.rb
state_machines-0.4.0 test/unit/branch/branch_with_multiple_except_to_requirements_test.rb
state_machines-0.3.0 test/unit/branch/branch_with_multiple_on_requirements_test.rb
state_machines-0.3.0 test/unit/branch/branch_with_multiple_except_to_requirements_test.rb
state_machines-0.2.2 test/unit/branch/branch_with_multiple_on_requirements_test.rb
state_machines-0.2.2 test/unit/branch/branch_with_multiple_except_to_requirements_test.rb
state_machines-0.2.1 test/unit/branch/branch_with_multiple_on_requirements_test.rb
state_machines-0.2.1 test/unit/branch/branch_with_multiple_except_to_requirements_test.rb
state_machines-0.2.0 test/unit/branch/branch_with_multiple_on_requirements_test.rb
state_machines-0.2.0 test/unit/branch/branch_with_multiple_except_to_requirements_test.rb
state_machines-0.1.4 test/unit/branch/branch_with_multiple_on_requirements_test.rb
state_machines-0.1.4 test/unit/branch/branch_with_multiple_except_to_requirements_test.rb
state_machines-0.1.3 test/unit/branch/branch_with_multiple_except_to_requirements_test.rb