class Lemon::TestModule::DSL

Evaluation scope for TestModule.

Public Instance Methods

ClassMethod(method, *tags, &block)
Alias for: class_unit
ClassUnit(method, *tags, &block)
Alias for: class_unit
Method(method, *tags, &block)
Alias for: unit
Unit(method, *tags, &block)
Alias for: unit
class_method(method, *tags, &block)

More specific nomencalture for `#class_unit`.

Alias for: class_unit
class_unit(method, *tags, &block) click to toggle source

Define a class-method unit test for this case.

# File lib/lemon/test_module.rb, line 88
def class_unit(method, *tags, &block)
  return if @_omit

  meth = TestClassMethod.new(
    :context   => @_testcase,
    :setup     => @_setup,
    :skip      => @_skip,
    :target    => method.to_sym,
    :tags      => tags,
    :singleton => true,
    &block
  )

  @_testcase.tests << meth

  meth
end
Also aliased as: ClassUnit, class_method, ClassMethod
context_class() click to toggle source

The class for which this is a DSL context.

# File lib/lemon/test_module.rb, line 48
def context_class
  TestModule
end
method(method, *tags, &block)

More specific nomencalture for `#unit`.

Alias for: unit
unit(method, *tags, &block) click to toggle source

Define a method-unit subcase for the class/module testcase.

@example

unit :puts do
  test "print message with new line to stdout" do
    puts "Hello"
  end
end
# File lib/lemon/test_module.rb, line 62
def unit(method, *tags, &block)
  return if @_omit

  meth = TestMethod.new(
    :context   => @_testcase, 
    :setup     => @_setup,
    :skip      => @_skip,
    :target    => method.to_sym,
    :tags      => tags,
    :singleton => false,
    &block
  )
  @_testcase.tests << meth
  meth
end
Also aliased as: Unit, method, Method