diff options
author | José Valim <jose.valim@gmail.com> | 2009-07-08 10:57:56 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-07-08 12:53:45 +0200 |
commit | 2699e9c2ddff13c5e19e1c95e838fa6d9a965c34 (patch) | |
tree | 7b705d9a2bf2ceb6c21c3047852d6f23f02e94b9 /railties/test | |
parent | c07746cbdfb7b60d2692c9c4a549e4e1b133865f (diff) | |
download | rails-2699e9c2ddff13c5e19e1c95e838fa6d9a965c34.tar.gz rails-2699e9c2ddff13c5e19e1c95e838fa6d9a965c34.tar.bz2 rails-2699e9c2ddff13c5e19e1c95e838fa6d9a965c34.zip |
Added config.generators with tests.
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/initializer_test.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/railties/test/initializer_test.rb b/railties/test/initializer_test.rb index 550cb7de76..da78647ab3 100644 --- a/railties/test/initializer_test.rb +++ b/railties/test/initializer_test.rb @@ -278,6 +278,35 @@ class InitializerPluginLoadingTests < Test::Unit::TestCase end end +class InitializerGeneratorsTests < Test::Unit::TestCase + def test_generators_empty_aliases_and_options + assert_equal({}, Rails::Configuration.new.generators.aliases) + assert_equal({}, Rails::Configuration.new.generators.options) + end + + def test_generators_set_options + config = Rails::Configuration.new + config.generators.orm :datamapper + config.generators.test_framework :rspec + assert_equal({ :orm => :datamapper, :test_framework => :rspec }, config.generators.options) + end + + def test_generators_set_aliases + config = Rails::Configuration.new + config.generators.aliases :test_framework => "-w" + assert_equal({ :test_framework => "-w" }, config.generators.aliases) + end + + def test_generators_with_block + config = Rails::Configuration.new + config.generators do |g| + g.orm :datamapper + g.test_framework :rspec + end + assert_equal({ :orm => :datamapper, :test_framework => :rspec }, config.generators.options) + end +end + class InitializerSetupI18nTests < Test::Unit::TestCase def test_no_config_locales_dir_present_should_return_empty_load_path File.stubs(:exist?).returns(false) |