mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Tests for metal generator.
This commit is contained in:
parent
f596495556
commit
5337766fa0
2 changed files with 18 additions and 4 deletions
18
railties/test/generators/metal_generator_test.rb
Normal file
18
railties/test/generators/metal_generator_test.rb
Normal file
|
@ -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
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue