Class: Lemon::TestMethod::DSL
- Inherits:
-
Lemon::TestCase::DSL
- Object
- Module
- World
- Lemon::TestCase::DSL
- Lemon::TestMethod::DSL
- Defined in:
- lib/lemon/test_method.rb
Overview
Scope for evaluating method test definitions.
Direct Known Subclasses
Instance Method Summary collapse
-
#context(label, *tags, &block) ⇒ Object
(also: #Context)
Create a sub-case of the method case.
-
#context_class ⇒ Object
The class for which this is a DSL context.
-
#test(label = nil, *tags, &block) ⇒ Object
(also: #Test)
Define a unit test for this case.
Methods inherited from Lemon::TestCase::DSL
#after, #before, #initialize, #omit, #setup, #skip, #teardown
Methods inherited from Module
Constructor Details
This class inherits a constructor from Lemon::TestCase::DSL
Instance Method Details
#context(label, *tags, &block) ⇒ Object Also known as: Context
Create a sub-case of the method case.
174 175 176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/lemon/test_method.rb', line 174 def context(label, *, &block) return if @_omit @_testcase.tests << TestMethod.new( :context => @_testcase, :target => @_testcase.target, :setup => @_setup, :skip => @_skip, :label => label, :tags => , &block ) end |
#context_class ⇒ Object
The class for which this is a DSL context.
142 143 144 |
# File 'lib/lemon/test_method.rb', line 142 def context_class TestMethod end |
#test(label = nil, *tags, &block) ⇒ Object Also known as: Test
Define a unit test for this case.
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/lemon/test_method.rb', line 154 def test(label=nil, *, &block) return if @_omit test = TestProc.new( :context => @_testcase, :setup => @_setup, :skip => @_skip, :label => label, :tags => , &block ) @_testcase.tests << test test end |