class BranchWithNilRequirementsTest

Public Instance Methods

setup() click to toggle source
# File test/unit/branch_test.rb, line 470
def setup
  @object = Object.new
  @branch = StateMachine::Branch.new(:from => nil, :to => nil)
end
test_should_include_all_known_states() click to toggle source
# File test/unit/branch_test.rb, line 491
def test_should_include_all_known_states
  assert_equal [nil], @branch.known_states
end
test_should_match_empty_query() click to toggle source
# File test/unit/branch_test.rb, line 475
def test_should_match_empty_query
  assert @branch.matches?(@object)
end
test_should_match_if_all_requirements_match() click to toggle source
# File test/unit/branch_test.rb, line 479
def test_should_match_if_all_requirements_match
  assert @branch.matches?(@object, :from => nil, :to => nil)
end
test_should_not_match_if_from_not_included() click to toggle source
# File test/unit/branch_test.rb, line 483
def test_should_not_match_if_from_not_included
  assert !@branch.matches?(@object, :from => :parked)
end
test_should_not_match_if_to_not_included() click to toggle source
# File test/unit/branch_test.rb, line 487
def test_should_not_match_if_to_not_included
  assert !@branch.matches?(@object, :to => :idling)
end