lib/dfect/mini.rb in dfect-1.0.0 vs lib/dfect/mini.rb in dfect-1.1.0
- old
+ new
@@ -1,9 +1,9 @@
# MiniTest emulation layer.
#--
-# Copyright 2009 Suraj N. Kurapati
-# See the LICENSE file for details.
+# Copyright protects this work.
+# See LICENSE file for details.
#++
require 'dfect'
require 'dfect/unit'
require 'dfect/spec'
@@ -19,9 +19,14 @@
{
:must => :assert,
:wont => :refute,
}.
each do |outer, inner|
+ #
+ # XXX: using eval() because Ruby 1.8 does
+ # not support default values and
+ # block parameters in define_method()
+ #
file, line = __FILE__, __LINE__ ; eval %{
class Object
def #{outer}_be_close_to other, message = nil
#{inner}_in_delta self, other, nil, message
end