aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-02-01 10:48:59 +0100
committerJosé Valim <jose.valim@gmail.com>2010-02-01 10:48:59 +0100
commita8c5d22c230ae46f410eed68c9b63ed31379ebbf (patch)
treee680f6d3d33f2fe0e63d4e6d94274d382029a0ae /railties/test
parent209235165266ff39f2d14d02b497d7d703788104 (diff)
downloadrails-a8c5d22c230ae46f410eed68c9b63ed31379ebbf.tar.gz
rails-a8c5d22c230ae46f410eed68c9b63ed31379ebbf.tar.bz2
rails-a8c5d22c230ae46f410eed68c9b63ed31379ebbf.zip
Add config.generators.fallbacks.
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/generators_test.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/railties/test/application/generators_test.rb b/railties/test/application/generators_test.rb
index e54edea07c..25fa100275 100644
--- a/railties/test/application/generators_test.rb
+++ b/railties/test/application/generators_test.rb
@@ -30,6 +30,7 @@ module ApplicationTests
assert_equal(true, c.generators.colorize_logging)
assert_equal({}, c.generators.aliases)
assert_equal({}, c.generators.options)
+ assert_equal({}, c.generators.fallbacks)
end
end
@@ -51,11 +52,20 @@ module ApplicationTests
end
end
- test "generators aliases and options on initialization" do
+ 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
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
RUBY
# Initialize the application
@@ -65,6 +75,7 @@ module ApplicationTests
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]
end
test "generators no color on initialization" do