Sha256: e0079da75991107694899ec823759061e0975cb50861bf833235ca7846bf7c38

Contents?: true

Size: 897 Bytes

Versions: 14

Compression:

Stored size: 897 Bytes

Contents

require_relative '../../test_helper'

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

  def test_should_match_if_if_is_true_and_unless_is_false
    branch = StateMachines::Branch.new(if: lambda { true }, unless: lambda { false })
    assert branch.match(@object)
  end

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

  def test_should_not_match_if_if_is_false_and_unless_is_false
    branch = StateMachines::Branch.new(if: lambda { false }, unless: lambda { false })
    refute branch.match(@object)
  end

  def test_should_not_match_if_if_is_true_and_unless_is_true
    branch = StateMachines::Branch.new(if: lambda { true }, unless: 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_conflicting_conditionals_test.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/state_machines-0.2.2/test/unit/branch/branch_with_conflicting_conditionals_test.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/state_machines-0.2.2/test/unit/branch/branch_with_conflicting_conditionals_test.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/state_machines-0.2.2/test/unit/branch/branch_with_conflicting_conditionals_test.rb
state_machines-0.4.0 test/unit/branch/branch_with_conflicting_conditionals_test.rb
state_machines-0.3.0 test/unit/branch/branch_with_conflicting_conditionals_test.rb
state_machines-0.2.2 test/unit/branch/branch_with_conflicting_conditionals_test.rb
state_machines-0.2.1 test/unit/branch/branch_with_conflicting_conditionals_test.rb
state_machines-0.2.0 test/unit/branch/branch_with_conflicting_conditionals_test.rb
state_machines-0.1.4 test/unit/branch/branch_with_conflicting_conditionals_test.rb
state_machines-0.1.3 test/unit/branch/branch_with_conflicting_conditionals_test.rb
state_machines-0.1.2 test/unit/branch/branch_with_conflicting_conditionals_test.rb
state_machines-0.1.1 test/unit/branch/branch_with_conflicting_conditionals_test.rb
state_machines-0.1.0 test/unit/branch/branch_with_conflicting_conditionals_test.rb