diff --git a/plugins/module_generator/README.md b/plugins/module_generator/README.md index e72a86b23..a3c2c7ad9 100644 --- a/plugins/module_generator/README.md +++ b/plugins/module_generator/README.md @@ -93,6 +93,16 @@ put that corporate copyright notice (or maybe a copyleft notice, if that's your ***************************/ ``` +### Test Defines + +You can specify the "#ifdef TEST" at the top of the test files with a custom define. +This example will put a "#ifdef CEEDLING_TEST" at the top of the test files. + +``` +:module_generator: + :test_define: CEEDLING_TEST +``` + ### Naming Convention Finally, you can force a particular naming convention. Even if someone calls the generator @@ -106,3 +116,4 @@ Your options are as follows: - `:snake` - snake_case_is_all_lower_and_uses_underscores - `:caps` - CAPS_FEELS_LIKE_YOU_ARE_SCREAMING + diff --git a/plugins/module_generator/lib/module_generator.rb b/plugins/module_generator/lib/module_generator.rb index c4096aed4..d14288c36 100755 --- a/plugins/module_generator/lib/module_generator.rb +++ b/plugins/module_generator/lib/module_generator.rb @@ -46,6 +46,7 @@ def divine_options(optz={}) :naming => ((defined? MODULE_GENERATOR_NAMING ) ? MODULE_GENERATOR_NAMING : nil ), :update_svn => ((defined? MODULE_GENERATOR_UPDATE_SVN ) ? MODULE_GENERATOR_UPDATE_SVN : false ), :skeleton_path=> ((defined? MODULE_GENERATOR_SOURCE_ROOT ) ? MODULE_GENERATOR_SOURCE_ROOT.gsub('\\', '/').sub(/^\//, '').sub(/\/$/, '') : "src" ), + :test_define => ((defined? MODULE_GENERATOR_TEST_DEFINE ) ? MODULE_GENERATOR_TEST_DEFINE : "TEST" ), } # Read Boilerplate template file.