From d627c932bdc5c0e2911e39cfb38952c29dab7afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 4 Nov 2009 00:14:44 -0200 Subject: Pass config.generators options along when RAILS_GENERATORS is set and show --force-plural message just once. Signed-off-by: Jeremy Kemper --- railties/test/application/generators_test.rb | 6 ++++-- railties/test/generators/resource_generator_test.rb | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'railties/test') diff --git a/railties/test/application/generators_test.rb b/railties/test/application/generators_test.rb index 445a867c85..bfbf1ffd16 100644 --- a/railties/test/application/generators_test.rb +++ b/railties/test/application/generators_test.rb @@ -1,4 +1,5 @@ require "isolation/abstract_unit" +RAILS_GENERATORS = true module ApplicationTests class GeneratorsTest < Test::Unit::TestCase @@ -23,7 +24,8 @@ module ApplicationTests Rails::Initializer.run do |c| c.generators.orm = :datamapper c.generators.test_framework = :rspec - expected = { :rails => { :orm => :datamapper, :test_framework => :rspec } } + c.generators.helper = false + expected = { :rails => { :orm => :datamapper, :test_framework => :rspec, :helper => false } } assert_equal(expected, c.generators.options) end end @@ -93,4 +95,4 @@ module ApplicationTests assert Rails::Generators.options.size >= 1 end end -end \ No newline at end of file +end diff --git a/railties/test/generators/resource_generator_test.rb b/railties/test/generators/resource_generator_test.rb index dcae81c204..886af01b22 100644 --- a/railties/test/generators/resource_generator_test.rb +++ b/railties/test/generators/resource_generator_test.rb @@ -75,7 +75,7 @@ class ResourceGeneratorTest < GeneratorsTestCase end def test_plural_names_are_singularized - content = run_generator ["accounts"] + content = run_generator ["accounts".freeze] assert_file "app/models/account.rb", /class Account < ActiveRecord::Base/ assert_file "test/unit/account_test.rb", /class AccountTest/ assert_match /Plural version of the model detected, using singularized version. Override with --force-plural./, content -- cgit v1.2.3