Module: MiniTestSpecRails::DSL::ClassMethods
- Defined in:
- lib/minitest-spec-rails/dsl.rb
Instance Method Summary collapse
- #after(type = nil, &block) ⇒ Object
- #before(type = nil, &block) ⇒ Object
- #describe(*args, &block) ⇒ Object
- #described_class ⇒ Object
- #test(name, &block) ⇒ Object
Instance Method Details
#after(type = nil, &block) ⇒ Object
22 23 24 |
# File 'lib/minitest-spec-rails/dsl.rb', line 22 def after(type = nil, &block) teardown { self.instance_eval(&block) } end |
#before(type = nil, &block) ⇒ Object
18 19 20 |
# File 'lib/minitest-spec-rails/dsl.rb', line 18 def before(type = nil, &block) setup { self.instance_eval(&block) } end |
#describe(*args, &block) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/minitest-spec-rails/dsl.rb', line 11 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 |
#described_class ⇒ Object
30 31 32 |
# File 'lib/minitest-spec-rails/dsl.rb', line 30 def described_class nil end |
#test(name, &block) ⇒ Object
26 27 28 |
# File 'lib/minitest-spec-rails/dsl.rb', line 26 def test(name, &block) it(name) { self.instance_eval(&block) } end |