* lib/test/unit/assertions.rb: fixed #assert_no_match message.

* test/testunit/test_assertions.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ntalbott 2003-12-01 19:25:51 +00:00
parent 062616677f
commit 6e4b8e19d7
3 changed files with 16 additions and 11 deletions

View file

@ -336,18 +336,17 @@ module Test
end
def test_assert_no_match
check_nothing_fails {
assert_no_match(/sling/, "string")
}
check_nothing_fails {
assert_no_match(/sling/, "string", "message")
}
check_fails(%Q{</string/> expected to not match\n<"string">.}) {
check_nothing_fails{assert_no_match(/sling/, "string")}
check_nothing_fails{assert_no_match(/sling/, "string", "message")}
check_fails(%Q{The first argument to assert_no_match should be a Regexp.\n<"asdf"> expected to be an instance of\n<Regexp> but was\n<String>.}) do
assert_no_match("asdf", "asdf")
end
check_fails(%Q{</string/> expected to not match\n<"string">.}) do
assert_no_match(/string/, "string")
}
check_fails(%Q{message.\n</string/> expected to not match\n<"string">.}) {
end
check_fails(%Q{message.\n</string/> expected to not match\n<"string">.}) do
assert_no_match(/string/, "string", "message")
}
end
end
def test_assert_throws