mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add tests for assert_pattern_list
This commit is contained in:
parent
c53667691a
commit
7c1ed47097
1 changed files with 16 additions and 0 deletions
|
@ -26,4 +26,20 @@ class TestAssertion < Test::Unit::TestCase
|
|||
return_in_assert_raise
|
||||
end
|
||||
end
|
||||
|
||||
def test_assert_pattern_list
|
||||
assert_pattern_list([/foo?/], "foo")
|
||||
assert_not_pattern_list([/foo?/], "afoo")
|
||||
assert_not_pattern_list([/foo?/], "foo?")
|
||||
assert_pattern_list([:*, /foo?/, :*], "foo")
|
||||
assert_pattern_list([:*, /foo?/], "afoo")
|
||||
assert_not_pattern_list([:*, /foo?/], "afoo?")
|
||||
assert_pattern_list([/foo?/, :*], "foo?")
|
||||
end
|
||||
|
||||
def assert_not_pattern_list(pattern_list, actual, message=nil)
|
||||
assert_raise(Test::Unit::AssertionFailedError) do
|
||||
assert_pattern_list(pattern_list, actual, message)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue