diff options
Diffstat (limited to 'railties/test/generators_test.rb')
-rw-r--r-- | railties/test/generators_test.rb | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/railties/test/generators_test.rb b/railties/test/generators_test.rb index 1264ac7764..5f9ee220dc 100644 --- a/railties/test/generators_test.rb +++ b/railties/test/generators_test.rb @@ -88,12 +88,6 @@ class GeneratorsTest < Rails::Generators::TestCase assert Rails::Generators.find_by_namespace(:model) end - def test_find_by_namespace_show_warning_if_generator_cant_be_loaded - output = capture(:stderr) { Rails::Generators.find_by_namespace(:wrong) } - assert_match(/\[WARNING\] Could not load generator/, output) - assert_match(/Rails 2\.x generator/, output) - end - def test_invoke_with_nested_namespaces model_generator = mock('ModelGenerator') do expects(:start).with(["Account"], {}) @@ -185,13 +179,6 @@ class GeneratorsTest < Rails::Generators::TestCase Rails::Generators.subclasses.delete(WithOptionsGenerator) end - def test_load_generators_from_railties - Rails::Generators::ModelGenerator.expects(:start).with(["Account"], {}) - Rails::Generators.send(:remove_instance_variable, :@generators_from_railties) - Rails.application.expects(:load_generators) - Rails::Generators.invoke("model", ["Account"]) - end - def test_rails_root_templates template = File.join(Rails.root, "lib", "templates", "active_record", "model", "model.rb") @@ -214,4 +201,10 @@ class GeneratorsTest < Rails::Generators::TestCase mspec = Rails::Generators.find_by_namespace :fixjour assert mspec.source_paths.include?(File.join(Rails.root, "lib", "templates", "fixjour")) end + + def test_usage_with_embedded_ruby + require File.expand_path("fixtures/lib/generators/usage_template/usage_template_generator", File.dirname(__FILE__)) + output = capture(:stdout) { Rails::Generators.invoke :usage_template, ['--help'] } + assert_match /:: 2 ::/, output + end end |