Class: Uncool::GeneratorLemon
- Inherits:
-
GeneratorAbstract
- Object
- GeneratorAbstract
- Uncool::GeneratorLemon
- Defined in:
- lib/uncool/generator/lemon.rb
Overview
Lemon test generator.
Instance Method Summary collapse
Methods inherited from GeneratorAbstract
#checklist, #covered?, #default_checklist, #initialize, #mapping, #namespaces, #options, #private?, #targets
Constructor Details
This class inherits a constructor from Uncool::GeneratorAbstract
Instance Method Details
#generate ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/uncool/generator/lemon.rb', line 9 def generate code = [] mapping.each do |target, units| #next if /Lemon::Test::Suite/ =~ target.to_s code << "TestCase #{target} do" units.each do |unit| next if unit.covered? and !covered? next if unit.private? and !private? if unit.function? code << "\n MetaUnit :#{unit.method} => '' do\n\n end" else code << "\n Unit :#{unit.method} => '' do\n\n end" end end code << "\nend\n" end code.join("\n") end |