Sha256: 8d148baad14b574e5576f1448dcb9b254d70d1f58981eac08689331c658f1550

Contents?: true

Size: 604 Bytes

Versions: 14

Compression:

Stored size: 604 Bytes

Contents

require_relative '../../test_helper'

class BranchWithMultipleUnlessConditionalsTest < StateMachinesTest
  def setup
    @object = Object.new
  end

  def test_should_match_if_all_are_false
    branch = StateMachines::Branch.new(unless: [lambda { false }, lambda { false }])
    assert branch.match(@object)
  end

  def test_should_not_match_if_any_are_true
    branch = StateMachines::Branch.new(unless: [lambda { true }, lambda { false }])
    refute branch.match(@object)

    branch = StateMachines::Branch.new(unless: [lambda { false }, lambda { true }])
    refute branch.match(@object)
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

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