Sha256: fe93a4731ee09b082c810acae5434f27362738d6584cf4d76e4f7cfe178bc9ec

Contents?: true

Size: 699 Bytes

Versions: 14

Compression:

Stored size: 699 Bytes

Contents

require_relative '../../test_helper'

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

  def test_should_have_an_if_condition
    branch = StateMachines::Branch.new(if: lambda { true })
    refute_nil branch.if_condition
  end

  def test_should_match_if_true
    branch = StateMachines::Branch.new(if: lambda { true })
    assert branch.matches?(@object)
  end

  def test_should_not_match_if_false
    branch = StateMachines::Branch.new(if: lambda { false })
    refute branch.matches?(@object)
  end

  def test_should_be_nil_if_unmatched
    branch = StateMachines::Branch.new(if: lambda { false })
    assert_nil 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_if_conditional_test.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/state_machines-0.2.2/test/unit/branch/branch_with_if_conditional_test.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/state_machines-0.2.2/test/unit/branch/branch_with_if_conditional_test.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/state_machines-0.2.2/test/unit/branch/branch_with_if_conditional_test.rb
state_machines-0.4.0 test/unit/branch/branch_with_if_conditional_test.rb
state_machines-0.3.0 test/unit/branch/branch_with_if_conditional_test.rb
state_machines-0.2.2 test/unit/branch/branch_with_if_conditional_test.rb
state_machines-0.2.1 test/unit/branch/branch_with_if_conditional_test.rb
state_machines-0.2.0 test/unit/branch/branch_with_if_conditional_test.rb
state_machines-0.1.4 test/unit/branch/branch_with_if_conditional_test.rb
state_machines-0.1.3 test/unit/branch/branch_with_if_conditional_test.rb
state_machines-0.1.2 test/unit/branch/branch_with_if_conditional_test.rb
state_machines-0.1.1 test/unit/branch/branch_with_if_conditional_test.rb
state_machines-0.1.0 test/unit/branch/branch_with_if_conditional_test.rb