summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorntalbott <ntalbott@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-01 19:25:51 +0000
committerntalbott <ntalbott@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-01 19:25:51 +0000
commit6e4b8e19d77ee82f6759ef117c576df6d3d84320 (patch)
tree7f7da22f9a6b40b483e2a9ecc3355674a0fbc017
parent062616677f26b9dfd1576c4157afcd77874ff6b1 (diff)
* 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
-rw-r--r--ChangeLog6
-rw-r--r--lib/test/unit/assertions.rb2
-rw-r--r--test/testunit/test_assertions.rb19
3 files changed, 16 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index ee9ec24606..0b7d90afc6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Dec 2 04:22:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+
+ * lib/test/unit/assertions.rb: fixed #assert_no_match message.
+
+ * test/testunit/test_assertions.rb: ditto.
+
Tue Dec 2 00:43:00 2003 why the lucky stiff <why@ruby-lang.org>
* ext/syck/syck.c: string buffering bug. decrementing by full
diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb
index 9730fe2670..3c2f7b98c0 100644
--- a/lib/test/unit/assertions.rb
+++ b/lib/test/unit/assertions.rb
@@ -229,7 +229,7 @@ EOT
public
def assert_no_match(regexp, string, message="")
_wrap_assertion do
- assert_instance_of(Regexp, regexp, "The first argument to assert_does_not_match should be a Regexp.")
+ assert_instance_of(Regexp, regexp, "The first argument to assert_no_match should be a Regexp.")
full_message = build_message(message, "<?> expected to not match\n<?>.", regexp, string)
assert_block(full_message) { regexp !~ string }
end
diff --git a/test/testunit/test_assertions.rb b/test/testunit/test_assertions.rb
index 0d79044dca..f62a6186e9 100644
--- a/test/testunit/test_assertions.rb
+++ b/test/testunit/test_assertions.rb
@@ -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