Class: Lemon::TestModule

Inherits:
TestCase show all
Defined in:
lib/lemon/test_module.rb

Overview

The nomenclature of a TestModule limts the focus of testing the methods of a module.

Direct Known Subclasses

TestClass

Defined Under Namespace

Classes: DSL

Instance Attribute Summary

Attributes inherited from TestCase

#advice, #context, #label, #setup, #skip, #target, #tests

Instance Method Summary collapse

Methods inherited from TestCase

#domain, #domain_class, #each, #evaluate, #run, #scope, #size, #skip!, #skip?, #tags

Constructor Details

#initialize(settings = {}, &block) ⇒ TestModule

New unit test.



15
16
17
18
# File 'lib/lemon/test_module.rb', line 15

def initialize(settings={}, &block)
  @tested = false
  super(settings)
end

Instance Method Details

#to_sObject

Gives the name of the target module.



37
38
39
# File 'lib/lemon/test_module.rb', line 37

def to_s
  target.to_s
end

#typeObject

The type of test case.



30
31
32
# File 'lib/lemon/test_module.rb', line 30

def type
  'Module'
end

#validate_settingsObject

Make sure the target is a module.



23
24
25
# File 'lib/lemon/test_module.rb', line 23

def validate_settings
  raise "#{@target} is not a module" unless Module === @target
end