summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorntalbott <ntalbott@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-05 02:17:07 +0000
committerntalbott <ntalbott@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-05 02:17:07 +0000
commitb60827ba047b594dea58adf68f4e983f21c32c04 (patch)
treefb22b342c09e128badede324be27d35a57ba0d74 /lib
parent0cf763af9c99cace8b4a44ce8160269931d207d2 (diff)
* lib/rubyunit.rb: aliasing TestCase into the top level is
problematic. * lib/runit/assert.rb: fixed a couple of bugs caused by recent refactoring in Test::Unit. * test/testunit/runit/*: added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/rubyunit.rb2
-rw-r--r--lib/runit/assert.rb16
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/rubyunit.rb b/lib/rubyunit.rb
index 8f1086c81d..1aca37864f 100644
--- a/lib/rubyunit.rb
+++ b/lib/rubyunit.rb
@@ -4,5 +4,3 @@
require 'runit/testcase'
require 'test/unit'
-
-TestCase = RUNIT::TestCase
diff --git a/lib/runit/assert.rb b/lib/runit/assert.rb
index ede7df1c92..c752b19a25 100644
--- a/lib/runit/assert.rb
+++ b/lib/runit/assert.rb
@@ -16,15 +16,13 @@ module RUNIT
assert_nothing_raised(*args, &block)
end
- # To deal with the fact that RubyUnit does not check that the regular expression
- # is, indeed, a regular expression, if it is not, we do our own assertion using
- # the same semantics as RubyUnit
+ # To deal with the fact that RubyUnit does not check that the
+ # regular expression is, indeed, a regular expression, if it is
+ # not, we do our own assertion using the same semantics as
+ # RubyUnit
def assert_match(actual_string, expected_re, message="")
_wrap_assertion {
- full_message = build_message(message, actual_string, expected_re) {
- | arg1, arg2 |
- "Expected <#{arg1}> to match <#{arg2}>"
- }
+ full_message = build_message(message, "Expected <?> to match <?>", actual_string, expected_re)
assert_block(full_message) {
expected_re =~ actual_string
}
@@ -32,6 +30,10 @@ module RUNIT
}
end
+ def assert_not_nil(actual, message="")
+ assert(!actual.nil?, message)
+ end
+
def assert_not_match(actual_string, expected_re, message="")
assert_no_match(expected_re, actual_string, message)
end