module Minitest::Spec::DSL

def it desc = "anonymous", &block

def it desc = "anonymous", &block
  block ||= proc { skip "(no tests defined)" }
  @specs ||= 0
  @specs += 1
  name = "test_%04d_%s" % [ @specs, desc ]
  undef_klasses = self.children.reject { |c| c.public_method_defined? name }
  define_method name, &block
  undef_klasses.each do |undef_klass|
    undef_klass.send :undef_method, name
  end
  name
end