Sha256: f7c770558888f38cb2f064ce05515690aaf66b652e67218ca2fe58ca5cc95d43
Contents?: true
Size: 793 Bytes
Versions: 14
Compression:
Stored size: 793 Bytes
Contents
module MiniTestSpecRails module DSL def self.included(klass) klass.extend ClassMethods remove_method :test if method_defined?(:test) end module ClassMethods def describe(*args, &block) stack = Minitest::Spec.describe_stack stack.push self if stack.empty? super(*args) { class_eval(&block) } stack.pop if stack.length == 1 end def before(_type = nil, &block) setup { instance_eval(&block) } end def after(_type = nil, &block) teardown { instance_eval(&block) } end def test(name, &block) instance_eval { it(name, &block) } end def described_class nil end end def described_class self.class.described_class end end end
Version data entries
14 entries across 14 versions & 1 rubygems