Class: Lemon::TestModule::DSL
- Inherits:
-
Lemon::TestCase::DSL
- Object
- Module
- World
- Lemon::TestCase::DSL
- Lemon::TestModule::DSL
- Defined in:
- lib/lemon/test_module.rb
Overview
Evaluation scope for TestModule.
Direct Known Subclasses
Instance Method Summary collapse
-
#class_unit(method, *tags, &block) ⇒ Object
(also: #ClassUnit, #class_method, #ClassMethod)
Define a class-method unit test for this case.
-
#context_class ⇒ Object
The class for which this is a DSL context.
-
#unit(method, *tags, &block) ⇒ Object
(also: #Unit, #method, #Method)
Define a method-unit subcase for the class/module testcase.
Methods inherited from Lemon::TestCase::DSL
#after, #before, #context, #initialize, #omit, #setup, #skip, #teardown
Methods inherited from Module
Constructor Details
This class inherits a constructor from Lemon::TestCase::DSL
Instance Method Details
#class_unit(method, *tags, &block) ⇒ Object Also known as: ClassUnit, class_method, ClassMethod
Define a class-method unit test for this case.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/lemon/test_module.rb', line 88 def class_unit(method, *, &block) return if @_omit meth = TestClassMethod.new( :context => @_testcase, :setup => @_setup, :skip => @_skip, :target => method.to_sym, :tags => , :singleton => true, &block ) @_testcase.tests << meth meth end |
#context_class ⇒ Object
The class for which this is a DSL context.
48 49 50 |
# File 'lib/lemon/test_module.rb', line 48 def context_class TestModule end |
#unit(method, *tags, &block) ⇒ Object Also known as: Unit, method, Method
Define a method-unit subcase for the class/module testcase.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/lemon/test_module.rb', line 62 def unit(method, *, &block) return if @_omit meth = TestMethod.new( :context => @_testcase, :setup => @_setup, :skip => @_skip, :target => method.to_sym, :tags => , :singleton => false, &block ) @_testcase.tests << meth meth end |