aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-07-28 08:48:21 +0200
committerJosé Valim <jose.valim@gmail.com>2009-07-28 08:48:21 +0200
commit419ca7a747dd2f33078f12c32b98d3b7ea0bffdb (patch)
tree4031f9a285e135934644db5f3f268f212376b71c /railties/test
parent67c2f53938654381d5d19bbdd046b82c6268aaff (diff)
downloadrails-419ca7a747dd2f33078f12c32b98d3b7ea0bffdb.tar.gz
rails-419ca7a747dd2f33078f12c32b98d3b7ea0bffdb.tar.bz2
rails-419ca7a747dd2f33078f12c32b98d3b7ea0bffdb.zip
Ensure that developers options are overwritten by user options.
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/generators_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/railties/test/generators_test.rb b/railties/test/generators_test.rb
index ea3f7d5487..103f9b7def 100644
--- a/railties/test/generators_test.rb
+++ b/railties/test/generators_test.rb
@@ -134,4 +134,18 @@ class GeneratorsTest < GeneratorsTestCase
TestUnit::Generators::ModelGenerator.expects(:start).with(["Account"], {})
Rails::Generators.invoke "super_shoulda:model", ["Account"]
end
+
+ def test_developer_options_are_overwriten_by_user_options
+ Rails::Generators.options[:new_generator] = { :generate => false }
+
+ klass = Class.new(Rails::Generators::Base) do
+ def self.name
+ "NewGenerator"
+ end
+
+ class_option :generate, :default => true
+ end
+
+ assert_equal false, klass.class_options[:generate].default
+ end
end