class BranchWithOnRequirementTest

Public Instance Methods

setup() click to toggle source
# File test/unit/branch_test.rb, line 192
def setup
  @object = Object.new
  @branch = StateMachine::Branch.new(:on => :ignite)
end
test_should_ignore_from() click to toggle source
# File test/unit/branch_test.rb, line 221
def test_should_ignore_from
  assert @branch.matches?(@object, :on => :ignite, :from => :parked)
end
test_should_ignore_to() click to toggle source
# File test/unit/branch_test.rb, line 217
def test_should_ignore_to
  assert @branch.matches?(@object, :on => :ignite, :to => :parked)
end
test_should_include_requirement_in_match() click to toggle source
# File test/unit/branch_test.rb, line 229
def test_should_include_requirement_in_match
  match = @branch.match(@object, :on => :ignite)
  assert_equal @branch.event_requirement, match[:on]
end
test_should_match_if_included() click to toggle source
# File test/unit/branch_test.rb, line 205
def test_should_match_if_included
  assert @branch.matches?(@object, :on => :ignite)
end
test_should_match_if_not_specified() click to toggle source
# File test/unit/branch_test.rb, line 201
def test_should_match_if_not_specified
  assert @branch.matches?(@object, :from => :parked)
end
test_should_not_be_included_in_known_states() click to toggle source
# File test/unit/branch_test.rb, line 225
def test_should_not_be_included_in_known_states
  assert_equal [], @branch.known_states
end
test_should_not_match_if_nil() click to toggle source
# File test/unit/branch_test.rb, line 213
def test_should_not_match_if_nil
  assert !@branch.matches?(@object, :on => nil)
end
test_should_not_match_if_not_included() click to toggle source
# File test/unit/branch_test.rb, line 209
def test_should_not_match_if_not_included
  assert !@branch.matches?(@object, :on => :park)
end
test_should_use_a_whitelist_matcher() click to toggle source
# File test/unit/branch_test.rb, line 197
def test_should_use_a_whitelist_matcher
  assert_instance_of StateMachine::WhitelistMatcher, @branch.event_requirement
end