Class: Uncool::GeneratorKO
- Inherits:
-
GeneratorAbstract
- Object
- GeneratorAbstract
- Uncool::GeneratorKO
- Defined in:
- lib/uncool/generator/ko.rb
Overview
KO 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 27 |
# File 'lib/uncool/generator/ko.rb', line 9 def generate code = [] mapping.each do |target, units| #next if /Lemon::Test::Suite/ =~ target.to_s code << "require 'lemon/syntax/ko'\n" code << "testcase #{target} do" units.each do |(unit, yes)| 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 |