class Lemon::TestMethod::DSL

Scope for evaluating method test definitions.

Public Instance Methods

Context(label, *tags, &block)
Alias for: context
Test(label=nil, *tags, &block)

Capitialized term.

Alias for: test
context(label, *tags, &block) click to toggle source

Create a sub-case of the method case.

# File lib/lemon/test_method.rb, line 174
def context(label, *tags, &block)
  return if @_omit

  @_testcase.tests << TestMethod.new(
    :context => @_testcase,
    :target  => @_testcase.target,
    :setup   => @_setup,
    :skip    => @_skip,
    :label   => label,
    :tags    => tags,
    &block
  )
end
Also aliased as: Context
context_class() click to toggle source

The class for which this is a DSL context.

# File lib/lemon/test_method.rb, line 142
def context_class
  TestMethod
end
test(label=nil, *tags, &block) click to toggle source

Define a unit test for this case.

@example

test "print message with new line to stdout" do
  puts "Hello"
end
# File lib/lemon/test_method.rb, line 154
def test(label=nil, *tags, &block)
  return if @_omit

  test  = TestProc.new(
    :context => @_testcase,
    :setup   => @_setup,
    :skip    => @_skip,
    :label   => label,
    :tags    => tags,
    &block
  )

  @_testcase.tests << test

  test
end
Also aliased as: Test