aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/generators_test.rb4
-rw-r--r--railties/test/application/initializer_test.rb34
-rw-r--r--railties/test/application/plugins_test.rb18
-rw-r--r--railties/test/initializer/check_ruby_version_test.rb4
-rw-r--r--railties/test/initializer/initialize_i18n_test.rb4
-rw-r--r--railties/test/initializer/path_test.rb2
6 files changed, 33 insertions, 33 deletions
diff --git a/railties/test/application/generators_test.rb b/railties/test/application/generators_test.rb
index 25c82578a3..03fecffdd0 100644
--- a/railties/test/application/generators_test.rb
+++ b/railties/test/application/generators_test.rb
@@ -43,7 +43,7 @@ module ApplicationTests
c.generators.test_framework :rspec
end
# Initialize the application
- Rails.application.new
+ Rails.initialize!
assert_equal :rspec, Rails::Generators.options[:rails][:test_framework]
assert_equal "-w", Rails::Generators.aliases[:rails][:test_framework]
@@ -55,7 +55,7 @@ module ApplicationTests
c.generators.colorize_logging = false
end
# Initialize the application
- Rails.application.new
+ Rails.initialize!
assert_equal Thor::Base.shell, Thor::Shell::Basic
end
diff --git a/railties/test/application/initializer_test.rb b/railties/test/application/initializer_test.rb
index 805ff8b6be..c2e64374d0 100644
--- a/railties/test/application/initializer_test.rb
+++ b/railties/test/application/initializer_test.rb
@@ -16,11 +16,11 @@ module ApplicationTests
if RUBY_VERSION < '1.9'
$KCODE = ''
- Rails.application.new
+ Rails.initialize!
assert_equal 'UTF8', $KCODE
else
Encoding.default_external = Encoding::US_ASCII
- Rails.application.new
+ Rails.initialize!
assert_equal Encoding::UTF_8, Encoding.default_external
end
end
@@ -30,7 +30,7 @@ module ApplicationTests
config.root = app_path
end
- Rails.application.new
+ Rails.initialize!
assert $:.include?("#{app_path}/app/models")
end
@@ -41,7 +41,7 @@ module ApplicationTests
end
assert_raises RuntimeError do
- Rails.application.new
+ Rails.initialize!
end
end
@@ -58,7 +58,7 @@ module ApplicationTests
config.eager_load_paths = "#{app_path}/lib"
end
- Rails.application.new
+ Rails.initialize!
assert Zoo
end
@@ -67,7 +67,7 @@ module ApplicationTests
app_file "config/environments/development.rb", "$initialize_test_set_from_env = 'success'"
assert_nil $initialize_test_set_from_env
Rails::Initializer.run { |config| config.root = app_path }
- Rails.application.new
+ Rails.initialize!
assert_equal "success", $initialize_test_set_from_env
end
@@ -77,7 +77,7 @@ module ApplicationTests
config.root = app_path
config.frameworks = []
end
- Rails.application.new
+ Rails.initialize!
end
end
@@ -86,7 +86,7 @@ module ApplicationTests
config.root = app_path
config.frameworks = [:action_controller]
end
- Rails.application.new
+ Rails.initialize!
assert $:.include?("#{framework_path}/actionpack/lib")
end
@@ -96,7 +96,7 @@ module ApplicationTests
config.root = app_path
config.frameworks = [:action_view]
end
- Rails.application.new
+ Rails.initialize!
assert $:.include?("#{framework_path}/actionpack/lib")
end
@@ -107,7 +107,7 @@ module ApplicationTests
config.after_initialize { $test_after_initialize_block1 = "success" }
config.after_initialize { $test_after_initialize_block2 = "congratulations" }
end
- Rails.application.new
+ Rails.initialize!
assert_equal "success", $test_after_initialize_block1
assert_equal "congratulations", $test_after_initialize_block2
@@ -120,7 +120,7 @@ module ApplicationTests
config.after_initialize # don't pass a block, this is what we're testing!
config.after_initialize { $test_after_initialize_block2 = "congratulations" }
end
- Rails.application.new
+ Rails.initialize!
assert_equal "success", $test_after_initialize_block1
assert_equal "congratulations", $test_after_initialize_block2
@@ -132,7 +132,7 @@ module ApplicationTests
config.root = app_path
config.i18n.default_locale = :de
end
- Rails.application.new
+ Rails.initialize!
assert_equal :de, I18n.default_locale
end
@@ -169,7 +169,7 @@ module ApplicationTests
config.root = app_path
config.action_controller.session_store = :cookie_store
end
- Rails.application.new
+ Rails.initialize!
assert !Rails.application.config.middleware.include?(ActiveRecord::SessionStore)
end
@@ -187,7 +187,7 @@ module ApplicationTests
c.root = app_path
c.action_controller.session_store = :active_record_store
end
- Rails.application.new
+ Rails.initialize!
expects = [ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActiveRecord::SessionStore]
middleware = Rails.application.config.middleware.map { |m| m.klass }
@@ -200,7 +200,7 @@ module ApplicationTests
c.frameworks -= [:action_controller]
c.action_controller.session_store = :active_record_store
end
- Rails.application.new
+ Rails.initialize!
assert !Rails.application.config.middleware.include?(ActiveRecord::SessionStore)
end
@@ -211,7 +211,7 @@ module ApplicationTests
c.root = app_path
c.frameworks -= [:action_view]
end
- Rails.application.new
+ Rails.initialize!
assert_equal nil, ActionMailer::Base.template_root
assert_equal [], ActionController::Base.view_paths
@@ -221,7 +221,7 @@ module ApplicationTests
Rails::Initializer.run do |c|
c.root = app_path
end
- Rails.application.new
+ Rails.initialize!
assert_instance_of Pathname, Rails.root
end
end
diff --git a/railties/test/application/plugins_test.rb b/railties/test/application/plugins_test.rb
index 6ea6d49460..0926ed106b 100644
--- a/railties/test/application/plugins_test.rb
+++ b/railties/test/application/plugins_test.rb
@@ -18,7 +18,7 @@ module ApplicationTests
test "all plugins are loaded when registered plugin list is untouched" do
Rails::Initializer.run { |c| c.root = app_path }
- Rails.application.new
+ Rails.initialize!
assert_plugins [
:a, :acts_as_chunky_bacon, :engine, :gemlike, :plugin_with_no_lib_dir, :stubby
], Rails.application.config.loaded_plugins, @failure_tip
@@ -32,7 +32,7 @@ module ApplicationTests
test "only the specified plugins are located in the order listed" do
plugin_names = [:plugin_with_no_lib_dir, :acts_as_chunky_bacon]
Rails::Initializer.run { |c| c.root = app_path; c.plugins = plugin_names }
- Rails.application.new
+ Rails.initialize!
assert_plugins plugin_names, Rails.application.config.loaded_plugins
end
@@ -41,7 +41,7 @@ module ApplicationTests
config.root = app_path
config.plugins = [:stubby, :all, :acts_as_chunky_bacon]
end
- Rails.application.new
+ Rails.initialize!
assert_plugins [:stubby, :a, :engine, :gemlike, :plugin_with_no_lib_dir, :acts_as_chunky_bacon], Rails.application.config.loaded_plugins, @failure_tip
end
@@ -51,7 +51,7 @@ module ApplicationTests
config.root = app_path
config.plugins = ['stubby', 'acts_as_chunky_bacon', :a, :plugin_with_no_lib_dir]
end
- Rails.application.new
+ Rails.initialize!
assert_plugins plugin_names, Rails.application.config.loaded_plugins, @failure_tip
end
@@ -61,8 +61,8 @@ module ApplicationTests
config.root = app_path
config.plugins = [:stubby, :acts_as_chunky_bacon, :all]
end
- Rails.application.new
-
+ Rails.initialize!
+
assert_plugins [:stubby, :acts_as_chunky_bacon, :a, :engine, :gemlike, :plugin_with_no_lib_dir], Rails.application.config.loaded_plugins, @failure_tip
end
@@ -71,7 +71,7 @@ module ApplicationTests
config.root = app_path
config.plugins = [:stubby, :acts_as_chunky_bacon]
end
- Rails.application.new
+ Rails.initialize!
assert $LOAD_PATH.include?("#{app_path}/vendor/plugins/default/stubby/lib")
assert $LOAD_PATH.include?("#{app_path}/vendor/plugins/default/acts/acts_as_chunky_bacon/lib")
@@ -84,7 +84,7 @@ module ApplicationTests
end
assert_raise(LoadError) do
- Rails.application.new
+ Rails.initialize!
end
end
@@ -97,7 +97,7 @@ module ApplicationTests
config.root = app_path
config.plugins = [:stubby, :acts_as_chunky_bacon, :non_existant_plugin1, :non_existant_plugin2]
end
- Rails.application.new
+ Rails.initialize!
flunk "Expected a LoadError but did not get one"
rescue LoadError => e
assert_plugins valid_plugins, Rails.application.config.loaded_plugins, @failure_tip
diff --git a/railties/test/initializer/check_ruby_version_test.rb b/railties/test/initializer/check_ruby_version_test.rb
index 6c32f5635b..0c725311ad 100644
--- a/railties/test/initializer/check_ruby_version_test.rb
+++ b/railties/test/initializer/check_ruby_version_test.rb
@@ -42,7 +42,7 @@ module InitializerTests
set_ruby_version(version)
assert_nothing_raised "It appears that rails does not boot" do
Rails::Initializer.run { |c| c.frameworks = [] }
- Rails.application.new
+ Rails.initialize!
end
end
@@ -51,7 +51,7 @@ module InitializerTests
$stderr = File.open("/dev/null", "w")
assert_raises(SystemExit) do
Rails::Initializer.run { |c| c.frameworks = [] }
- Rails.application.new
+ Rails.initialize!
end
end
end
diff --git a/railties/test/initializer/initialize_i18n_test.rb b/railties/test/initializer/initialize_i18n_test.rb
index 92ac1312bf..04b44cedd0 100644
--- a/railties/test/initializer/initialize_i18n_test.rb
+++ b/railties/test/initializer/initialize_i18n_test.rb
@@ -15,7 +15,7 @@ module InitializerTests
c.root = app_path
c.i18n.load_path << "my/other/locale.yml"
end
- Rails.application.new
+ Rails.initialize!
#{RAILS_FRAMEWORK_ROOT}/railties/test/fixtures/plugins/engines/engine/config/locales/en.yml
assert_equal %W(
@@ -38,7 +38,7 @@ module InitializerTests
c.root = app_path
c.i18n.load_path << "my/other/locale.yml"
end
- Rails.application.new
+ Rails.initialize!
#{RAILS_FRAMEWORK_ROOT}/railties/test/fixtures/plugins/engines/engine/config/locales/en.yml
assert_equal %W(
diff --git a/railties/test/initializer/path_test.rb b/railties/test/initializer/path_test.rb
index 29acbdbd25..9c36bb2000 100644
--- a/railties/test/initializer/path_test.rb
+++ b/railties/test/initializer/path_test.rb
@@ -13,7 +13,7 @@ class PathsTest < Test::Unit::TestCase
ActionController::Base.session_store = nil
end
end
- Rails.application.new
+ Rails.initialize!
@paths = Rails.application.config.paths
end