diff options
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/metal_generator_test.rb | 18 | ||||
-rw-r--r-- | railties/test/generators/plugin_generator_test.rb | 4 |
2 files changed, 18 insertions, 4 deletions
diff --git a/railties/test/generators/metal_generator_test.rb b/railties/test/generators/metal_generator_test.rb new file mode 100644 index 0000000000..dfa948d14e --- /dev/null +++ b/railties/test/generators/metal_generator_test.rb @@ -0,0 +1,18 @@ +require 'abstract_unit' +require 'generators/generators_test_helper' +require 'generators/rails/metal/metal_generator' + +class MetalGeneratorTest < GeneratorsTestCase + + def test_metal_skeleton_is_created + run_generator + assert_file "app/metal/foo.rb", /class Foo/ + end + + protected + + def run_generator(args=[]) + silence(:stdout) { Rails::Generators::MetalGenerator.start ["foo"].concat(args), :root => destination_root } + end + +end diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb index a28a007ff8..b4aa39ae5f 100644 --- a/railties/test/generators/plugin_generator_test.rb +++ b/railties/test/generators/plugin_generator_test.rb @@ -44,8 +44,4 @@ class PluginGeneratorTest < GeneratorsTestCase silence(:stdout) { Rails::Generators::PluginGenerator.start ["plugin_fu"].concat(args), :root => destination_root } end - def generator(options={}) - @generator ||= Rails::Generators::PluginGenerator.new(["plugin_fu"], options, :root => destination_root) - end - end |