tests: define assert_empty for Ruby <= 1.8

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2012-10-25 22:09:23 -05:00
parent 762c355b30
commit 267ffddbd3

View File

@ -88,3 +88,10 @@ module VersionAssertions
assert_nil Version.parse(url) assert_nil Version.parse(url)
end end
end end
module Test::Unit::Assertions
def assert_empty(obj, msg=nil)
assert_respond_to(obj, :empty?, msg)
assert(obj.empty?, msg)
end if RUBY_VERSION.to_f <= 1.8
end