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: Scope

Instance Attribute Summary

Attributes inherited from TestCase

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

Instance Method Summary collapse

Methods inherited from TestCase

#each, #evaluate, #run, #scope, #scope_class, #size, #skip!, #skip?

Constructor Details

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

New unit test.



12
13
14
15
# File 'lib/lemon/test_module.rb', line 12

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

Instance Method Details

#to_sObject

Gives the name of the target module.



28
29
30
# File 'lib/lemon/test_module.rb', line 28

def to_s
  target.to_s
end

#typeObject

The type of test case.



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

def type
  'Module'
end

#validate_settingsObject

Make sure the target is a module.



18
19
20
# File 'lib/lemon/test_module.rb', line 18

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