class BranchWithMultipleIfConditionalsTest

Public Instance Methods

setup() click to toggle source
# File test/unit/branch_test.rb, line 646
def setup
  @object = Object.new
end
test_should_match_if_all_are_true() click to toggle source
# File test/unit/branch_test.rb, line 650
def test_should_match_if_all_are_true
  branch = StateMachine::Branch.new(:if => [lambda {true}, lambda {true}])
  assert branch.match(@object)
end
test_should_not_match_if_any_are_false() click to toggle source
# File test/unit/branch_test.rb, line 655
def test_should_not_match_if_any_are_false
  branch = StateMachine::Branch.new(:if => [lambda {true}, lambda {false}])
  assert !branch.match(@object)
  
  branch = StateMachine::Branch.new(:if => [lambda {false}, lambda {true}])
  assert !branch.match(@object)
end