diff options
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) |