diff options
author | Carlhuda <carlhuda@engineyard.com> | 2009-12-22 17:03:23 -0800 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2009-12-23 15:16:38 -0800 |
commit | dc677f7665e5ec74b5a313ba656bba19dc0f853d (patch) | |
tree | 589200f34212e8944621ce03d7323e9bbd6771eb /railties/test/application/generators_test.rb | |
parent | 24e1b5560806be54a931922f109f50800dcbbdf5 (diff) | |
download | rails-dc677f7665e5ec74b5a313ba656bba19dc0f853d.tar.gz rails-dc677f7665e5ec74b5a313ba656bba19dc0f853d.tar.bz2 rails-dc677f7665e5ec74b5a313ba656bba19dc0f853d.zip |
tests pass with requiring the frameworks in rails.rb
Diffstat (limited to 'railties/test/application/generators_test.rb')
-rw-r--r-- | railties/test/application/generators_test.rb | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/railties/test/application/generators_test.rb b/railties/test/application/generators_test.rb index 2ed49d1057..7b27c780aa 100644 --- a/railties/test/application/generators_test.rb +++ b/railties/test/application/generators_test.rb @@ -7,8 +7,6 @@ module ApplicationTests def setup build_app boot_rails - require "rails" - require "rails/generators" end def app_const @@ -16,6 +14,8 @@ module ApplicationTests end def with_config + require "rails" + require "rails/generators" yield app_const.config end @@ -46,14 +46,15 @@ module ApplicationTests end test "generators aliases and options on initialization" do - application = with_config do |c| - c.frameworks = [] - c.generators.rails :aliases => { :test_framework => "-w" } - c.generators.orm :datamapper - c.generators.test_framework :rspec - end + add_to_config <<-RUBY + config.generators.rails :aliases => { :test_framework => "-w" } + config.generators.orm :datamapper + config.generators.test_framework :rspec + RUBY + + require "#{app_path}/config/environment" # Initialize the application - app_const.initialize! + require "rails/generators" Rails::Generators.configure! assert_equal :rspec, Rails::Generators.options[:rails][:test_framework] @@ -61,12 +62,13 @@ module ApplicationTests end test "generators no color on initialization" do - with_config do |c| - c.frameworks = [] - c.generators.colorize_logging = false - end + add_to_config <<-RUBY + config.generators.colorize_logging = false + RUBY + # Initialize the application - app_const.initialize! + require "#{app_path}/config/environment" + require "rails/generators" Rails::Generators.configure! assert_equal Thor::Base.shell, Thor::Shell::Basic |