class BranchWithUnlessConditionalTest

Public Instance Methods

setup() click to toggle source
# File test/unit/branch_test.rb, line 665
def setup
  @object = Object.new
end
test_should_be_nil_if_unmatched() click to toggle source
# File test/unit/branch_test.rb, line 684
def test_should_be_nil_if_unmatched
  branch = StateMachine::Branch.new(:unless => lambda {true})
  assert_nil branch.match(@object)
end
test_should_have_an_unless_condition() click to toggle source
# File test/unit/branch_test.rb, line 669
def test_should_have_an_unless_condition
  branch = StateMachine::Branch.new(:unless => lambda {true})
  assert_not_nil branch.unless_condition
end
test_should_match_if_false() click to toggle source
# File test/unit/branch_test.rb, line 674
def test_should_match_if_false
  branch = StateMachine::Branch.new(:unless => lambda {false})
  assert branch.matches?(@object)
end
test_should_not_match_if_true() click to toggle source
# File test/unit/branch_test.rb, line 679
def test_should_not_match_if_true
  branch = StateMachine::Branch.new(:unless => lambda {true})
  assert !branch.matches?(@object)
end