test/method_delegation_test.rb in rgen-0.8.2 vs test/method_delegation_test.rb in rgen-0.8.3
- old
+ new
@@ -1,11 +1,11 @@
$:.unshift File.dirname(__FILE__) + "/../lib"
-require 'test/unit'
+require 'minitest/autorun'
require 'rgen/util/method_delegation'
-class MethodDelegationTest < Test::Unit::TestCase
+class MethodDelegationTest < MiniTest::Test
include RGen
class TestDelegate
attr_accessor :mode, :callcount
def common_delegated(delegator)
@@ -86,11 +86,11 @@
assert_equal "SomeArbitraryConst", SomeArbitraryConst.to_s
assert_equal "AnotherConst::A::B::C", AnotherConst::A::B::C.to_s
Util::MethodDelegation.unregisterDelegate(ConstPathElement, surroundingModule, "const_missing")
- assert_raise NameError do
+ assert_raises NameError do
SomeArbitraryConst
end
end
def checkDelegation(delegator, method, originalResult, newMethod=false)
@@ -121,11 +121,11 @@
# delegate2 is not called
assert_equal 0, delegate2.callcount
delegate1.mode = :nothing
# delegate1 just exits and thus returns nil
- assert_equal nil, delegator.send(method)
+ assert_nil delegator.send(method)
assert_equal 2, delegate1.callcount
# delegate2 is not called
assert_equal 0, delegate2.callcount
delegate1.mode = :continue
@@ -165,10 +165,10 @@
assert !delegator.respond_to?(:_methodDelegates)
end
def checkCallOriginal(delegator, method, originalResult, newMethod)
if newMethod
- assert_raise NoMethodError do
+ assert_raises NoMethodError do
result = delegator.send(method)
end
else
result = delegator.send(method)
assert_equal originalResult, result