class BranchWithToRequirementTest
Public Instance Methods
setup()
click to toggle source
# File test/unit/branch_test.rb, line 129 def setup @object = Object.new @branch = StateMachine::Branch.new(:to => :idling) end
test_should_be_included_in_known_states()
click to toggle source
# File test/unit/branch_test.rb, line 162 def test_should_be_included_in_known_states assert_equal [:idling], @branch.known_states end
test_should_ignore_from()
click to toggle source
# File test/unit/branch_test.rb, line 154 def test_should_ignore_from assert @branch.matches?(@object, :to => :idling, :from => :parked) end
test_should_ignore_on()
click to toggle source
# File test/unit/branch_test.rb, line 158 def test_should_ignore_on assert @branch.matches?(@object, :to => :idling, :on => :ignite) end
test_should_include_requirement_in_match()
click to toggle source
# File test/unit/branch_test.rb, line 166 def test_should_include_requirement_in_match match = @branch.match(@object, :to => :idling) assert_equal @branch.state_requirements.first[:to], match[:to] end
test_should_match_if_included()
click to toggle source
# File test/unit/branch_test.rb, line 142 def test_should_match_if_included assert @branch.matches?(@object, :to => :idling) end
test_should_match_if_not_specified()
click to toggle source
# File test/unit/branch_test.rb, line 138 def test_should_match_if_not_specified assert @branch.matches?(@object, :from => :parked) end
test_should_not_match_if_nil()
click to toggle source
# File test/unit/branch_test.rb, line 150 def test_should_not_match_if_nil assert !@branch.matches?(@object, :to => nil) end
test_should_not_match_if_not_included()
click to toggle source
# File test/unit/branch_test.rb, line 146 def test_should_not_match_if_not_included assert !@branch.matches?(@object, :to => :parked) end
test_should_use_a_whitelist_matcher()
click to toggle source
# File test/unit/branch_test.rb, line 134 def test_should_use_a_whitelist_matcher assert_instance_of StateMachine::WhitelistMatcher, @branch.state_requirements.first[:to] end