class WhitelistMatcherTest
Public Instance Methods
setup()
click to toggle source
# File test/unit/matcher_test.rb, line 74 def setup @matcher = StateMachine::WhitelistMatcher.new([:parked, :idling]) end
test_should_filter_unknown_values()
click to toggle source
# File test/unit/matcher_test.rb, line 82 def test_should_filter_unknown_values assert_equal [:parked, :idling], @matcher.filter([:parked, :idling, :first_gear]) end
test_should_have_a_description()
click to toggle source
# File test/unit/matcher_test.rb, line 94 def test_should_have_a_description assert_equal '[:parked, :idling]', @matcher.description matcher = StateMachine::WhitelistMatcher.new([:parked]) assert_equal ':parked', matcher.description end
test_should_have_values()
click to toggle source
# File test/unit/matcher_test.rb, line 78 def test_should_have_values assert_equal [:parked, :idling], @matcher.values end
test_should_match_known_values()
click to toggle source
# File test/unit/matcher_test.rb, line 86 def test_should_match_known_values assert @matcher.matches?(:parked) end
test_should_not_match_unknown_values()
click to toggle source
# File test/unit/matcher_test.rb, line 90 def test_should_not_match_unknown_values assert !@matcher.matches?(:first_gear) end