Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Changed spec test class creation to be non-destructive
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//src/minitest/dev/": change = 4662]
  • Loading branch information
zenspider committed Mar 2, 2009
1 parent 3764de2 commit 59d61df
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/minitest/spec.rb
Expand Up @@ -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!

Expand Down

0 comments on commit 59d61df

Please sign in to comment.