Sha256: cff32058f1d385888162c02c457d9c60fe464611faf0b828bc8fee20e3ab0dc7

Contents?: true

Size: 702 Bytes

Versions: 14

Compression:

Stored size: 702 Bytes

Contents

require_relative '../../test_helper'

class BranchWithNilRequirementsTest < StateMachinesTest
  def setup
    @object = Object.new
    @branch = StateMachines::Branch.new(from: nil, to: nil)
  end

  def test_should_match_empty_query
    assert @branch.matches?(@object)
  end

  def test_should_match_if_all_requirements_match
    assert @branch.matches?(@object, from: nil, to: nil)
  end

  def test_should_not_match_if_from_not_included
    refute @branch.matches?(@object, from: :parked)
  end

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

  def test_should_include_all_known_states
    assert_equal [nil], @branch.known_states
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

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