diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-01 01:12:31 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-01 01:12:31 +0000 |
commit | 54fd6de064142633f3bb592b0bd6486d262cd2b2 (patch) | |
tree | c86d22ef1ed214ecc725f261aa313993e08d041d /lib/minitest/spec.rb | |
parent | 22b2c638553c26e265a88a6b68ec31d132361ec7 (diff) | |
download | ruby-54fd6de064142633f3bb592b0bd6486d262cd2b2.tar.gz |
Revert r29986: "Imported minitest 2.0.0 r5952"
This breaks test-all:
* two test-all errors (test_run_passing and test_run_failing_filtered).
* -v option to test-all is ignored
Additional to say, please describe summary of the change when you
import from external repository.
And, RUN test-all BEFORE COMMIT.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/minitest/spec.rb')
-rw-r--r-- | lib/minitest/spec.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/minitest/spec.rb b/lib/minitest/spec.rb index 8e2412e5ea..2050337015 100644 --- a/lib/minitest/spec.rb +++ b/lib/minitest/spec.rb @@ -66,13 +66,10 @@ module Kernel def describe desc, &block stack = MiniTest::Spec.describe_stack - name = [stack.last, desc].compact.join("::") - cls = Class.new(stack.last || MiniTest::Spec) - - # :stopdoc: - # omg this sucks - (class << cls; self; end).send(:define_method, :to_s) { name } - # :startdoc: + name = desc.to_s.split(/\W+/).map { |s| s.capitalize }.join + "Spec" + prev = stack.last + name = "#{prev == MiniTest::Spec ? nil : prev}::#{name}" + cls = Object.class_eval "class #{name} < #{prev}; end; #{name}" cls.nuke_test_methods! @@ -99,7 +96,7 @@ end class MiniTest::Spec < MiniTest::Unit::TestCase - @@describe_stack = [] + @@describe_stack = [MiniTest::Spec] def self.describe_stack # :nodoc: @@describe_stack end |