Class: DevSystem::SimpleGeneratorTest
- Inherits:
-
GeneratorTest
- Object
- Liza::Unit
- Liza::Test
- Liza::UnitTest
- Liza::ControllerTest
- GeneratorTest
- DevSystem::SimpleGeneratorTest
- Defined in:
- lib/dev_system/sub/generator/generators/simple_generator_test.rb
Direct Known Subclasses
BenchGeneratorTest, CommandGeneratorTest, LogGeneratorTest, NewGeneratorTest, NotFoundGeneratorTest, ShellGeneratorTest, SystemGeneratorTest, HappySystem::AxoGeneratorTest, NetSystem::ClientGeneratorTest, NetSystem::RecordGeneratorTest, WebSystem::RequestGeneratorTest
Instance Method Summary collapse
- #assert_change(index, path, lines_count, first_line, kaller: nil) ⇒ Object
- #assert_change_count(count, kaller: nil) ⇒ Object
-
#call_with(name, coil, placement, superklass, path) ⇒ Object
helper methods.
Methods inherited from Liza::UnitTest
Methods inherited from Liza::Test
Methods inherited from Liza::Unit
const_missing, division, part, system, #system, test_class
Instance Method Details
#assert_change(index, path, lines_count, first_line, kaller: nil) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/dev_system/sub/generator/generators/simple_generator_test.rb', line 29 def assert_change index, path, lines_count, first_line, kaller: nil kaller ||= caller unless assert subject.changes[index].path.to_s.end_with?(path), kaller: kaller puts stick :red, "#{subject.changes[index].path.inspect} does not end with #{path.inspect}" end assert_equality subject.changes[index].new_lines.count, lines_count, kaller: kaller assert_equality subject.changes[index].new_lines[0].strip, first_line, kaller: kaller end |
#assert_change_count(count, kaller: nil) ⇒ Object
24 25 26 27 |
# File 'lib/dev_system/sub/generator/generators/simple_generator_test.rb', line 24 def assert_change_count count, kaller: nil kaller ||= caller assert_equality subject.changes.count, count, kaller: kaller end |
#call_with(name, coil, placement, superklass, path) ⇒ Object
helper methods
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/dev_system/sub/generator/generators/simple_generator_test.rb', line 13 def call_with(name, coil, placement, superklass, path) env = {} env[:name] = name.to_s env[:generator_coil] = coil.to_s env[:placement] = placement env[:superclass] = superklass env[:path] = path subject.call env end |