Module: RubiGen::GeneratorTestHelper

Module | RubiGen::GeneratorTestHelper
In: | lib/rubigen/helpers/generator_test_helper.rb

### Methods

app_root_files assert_directory_exists assert_file_exists assert_generated_class assert_generated_file assert_generated_module assert_generated_test_for assert_has_method bare_setup bare_teardown build_generator rubygem_folders rubygems_setup rubygems_teardown run_generator silence_generator

### Public Instance methods

app_root_files()
assert_directory_exists(path)

asserts that the given directory exists

assert_file_exists(path)

asserts that the given file exists

assert_generated_class(path,parent=nil) {|body if block_given?| ...}

asserts that the given class source file was generated. It takes a path without the `.rb` part and an optional super class. the contents of the class source file is passed to a block.

assert_generated_file(path) {|f.read if block_given?| ...}

asserts that the given file was generated. the contents of the file is passed to a block.

assert_generated_module(path) {|body if block_given?| ...}

asserts that the given module source file was generated. It takes a path without the `.rb` part. the contents of the class source file is passed to a block.

assert_generated_test_for(name, parent="Test::Unit::TestCase") {|body if block_given?| ...}

asserts that the given unit test was generated. It takes a name or symbol without the `test_` part and an optional super class. the contents of the class source file is passed to a block.

assert_has_method(body,*methods) {|name, $1| ...}

asserts that the given methods are defined in the body. This does assume standard rails code conventions with regards to the source code. The body of each individual method is passed to a block.

bare_setup()
bare_teardown()
build_generator(name, params, sources, options)

Instatiates the Generator

rubygem_folders()
rubygems_setup()
rubygems_teardown()
run_generator(name, params, sources, options = {})

Runs the create command (like the command line does)

silence_generator() {|if block_given?| ...}

Silences the logger temporarily and returns the output as a String

[Validate]