diff options
author | José Valim <jose.valim@gmail.com> | 2010-02-06 17:32:06 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-02-06 17:32:06 +0100 |
commit | 6958eac1a00a4ab33e3facc70c80a07492288196 (patch) | |
tree | 06df21a64b2111690701b273e121620437afe155 /railties/test/application | |
parent | 1d9d9d2d89a90a85f27a1909e3c435c070bc1b40 (diff) | |
download | rails-6958eac1a00a4ab33e3facc70c80a07492288196.tar.gz rails-6958eac1a00a4ab33e3facc70c80a07492288196.tar.bz2 rails-6958eac1a00a4ab33e3facc70c80a07492288196.zip |
Add config.generators.templates to provide alternative paths for template lookup.
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/generators_test.rb | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/railties/test/application/generators_test.rb b/railties/test/application/generators_test.rb index 25fa100275..712c8bef36 100644 --- a/railties/test/application/generators_test.rb +++ b/railties/test/application/generators_test.rb @@ -52,30 +52,23 @@ module ApplicationTests end end - test "generators set rails fallbacks" do - with_config do |c| - c.generators.fallbacks[:shoulda] = :test_unit - expected = { :shoulda => :test_unit } - assert_equal expected, c.generators.fallbacks - end - end - - test "generators aliases, options and fallbacks on initialization" do + test "generators aliases, options, templates and fallbacks on initialization" do add_to_config <<-RUBY config.generators.rails :aliases => { :test_framework => "-w" } config.generators.orm :datamapper config.generators.test_framework :rspec config.generators.fallbacks[:shoulda] = :test_unit + config.generators.templates << "some/where" RUBY # Initialize the application require "#{app_path}/config/environment" require "rails/generators" - Rails::Generators.configure! assert_equal :rspec, Rails::Generators.options[:rails][:test_framework] assert_equal "-w", Rails::Generators.aliases[:rails][:test_framework] - assert_equal :test_unit, Rails::Generators.fallbacks[:shoulda] + assert_equal Hash[:shoulda => :test_unit], Rails::Generators.fallbacks + assert_equal ["#{app_path}/lib/templates", "some/where"], Rails::Generators.templates_path end test "generators no color on initialization" do |