class BranchWithIfConditionalTest

Public Instance Methods

setup() click to toggle source
# File test/unit/branch_test.rb, line 620
def setup
  @object = Object.new
end
test_should_be_nil_if_unmatched() click to toggle source
# File test/unit/branch_test.rb, line 639
def test_should_be_nil_if_unmatched
  branch = StateMachine::Branch.new(:if => lambda {false})
  assert_nil branch.match(@object)
end
test_should_have_an_if_condition() click to toggle source
# File test/unit/branch_test.rb, line 624
def test_should_have_an_if_condition
  branch = StateMachine::Branch.new(:if => lambda {true})
  assert_not_nil branch.if_condition
end
test_should_match_if_true() click to toggle source
# File test/unit/branch_test.rb, line 629
def test_should_match_if_true
  branch = StateMachine::Branch.new(:if => lambda {true})
  assert branch.matches?(@object)
end
test_should_not_match_if_false() click to toggle source
# File test/unit/branch_test.rb, line 634
def test_should_not_match_if_false
  branch = StateMachine::Branch.new(:if => lambda {false})
  assert !branch.matches?(@object)
end