Permalink
Browse files

Changed spec test class creation to be non-destructive

[git-p4: depot-paths = "//src/minitest/dev/": change = 4662]
  • Loading branch information...
1 parent 3764de2 commit 59d61dfa74a63397ee88f648e023c23c2cfbc52f @zenspider zenspider committed Mar 2, 2009
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/minitest/spec.rb
View
@@ -50,9 +50,8 @@ class Object
module Kernel
def describe desc, &block
stack = MiniTest::Spec.describe_stack
- cls = Class.new(stack.last)
- klass_name = desc.to_s.split(/\W+/).map { |s| s.capitalize }.join + "Spec"
- Object.const_set klass_name, cls
+ name = desc.to_s.split(/\W+/).map { |s| s.capitalize }.join + "Spec"
+ cls = Object.class_eval "class #{name} < #{stack.last}; end; #{name}"
cls.nuke_test_methods!

0 comments on commit 59d61df

Please sign in to comment.