lib/lemon/dsl.rb in lemon-0.8.0 vs lib/lemon/dsl.rb in lemon-0.8.1

- old
+ new

@@ -50,11 +50,11 @@ # the Case singleton class. So to work around we must note each test # before it is run, and reroute the missing constants. # # This sucks and it is not thread safe. If anyone know how to fix, # please let me know. See Unit#call for the other end of this hack. - +# def Object.const_missing(name) if unit = Lemon.test_stack.last begin (class << unit.testcase; self; end).const_get(name) rescue NameError @@ -62,9 +62,19 @@ end else super(name) end end + +#def Object.const_missing(name) +# if unit = Lemon.test_stack.last +# klass = (class << unit.testcase; self; end) +# if klass.const_defined?(name) +# return klass.const_get(name) +# end +# end +# super(name) +#end # Get current running test. Used for the BIG FAT HACK. def Lemon.test_stack @@test_stack ||= [] end