module Kernel
def describe desc, &block # :doc:
def describe desc, &block # :doc: stack = MiniTest::Spec.describe_stack name = [stack.last, desc].compact.join("::") sclas = stack.last || if Class === self && self < MiniTest::Spec then self else MiniTest::Spec.spec_type desc end cls = Class.new sclas sclas.children << cls unless cls == MiniTest::Spec # :stopdoc: # omg this sucks (class << cls; self; end).send(:define_method, :to_s) { name } (class << cls; self; end).send(:define_method, :desc) { desc } # :startdoc: cls.nuke_test_methods! stack.push cls cls.class_eval(&block) stack.pop cls end