diff options
Diffstat (limited to 'railties/test/application/initializers')
7 files changed, 32 insertions, 4 deletions
diff --git a/railties/test/application/initializers/boot_test.rb b/railties/test/application/initializers/boot_test.rb index 5ec562f12f..b1e01dc13f 100644 --- a/railties/test/application/initializers/boot_test.rb +++ b/railties/test/application/initializers/boot_test.rb @@ -9,8 +9,12 @@ module ApplicationTests # boot_rails end + def teardown + # teardown_app + end + test "booting rails sets the load paths correctly" do # This test is pending reworking the boot process end end -end
\ No newline at end of file +end diff --git a/railties/test/application/initializers/check_ruby_version_test.rb b/railties/test/application/initializers/check_ruby_version_test.rb index 5b6196307d..df7e9696a9 100644 --- a/railties/test/application/initializers/check_ruby_version_test.rb +++ b/railties/test/application/initializers/check_ruby_version_test.rb @@ -9,6 +9,10 @@ module ApplicationTests boot_rails end + def teardown + teardown_app + end + test "rails initializes with ruby 1.8.7 or later, except for 1.9.1" do if RUBY_VERSION < '1.8.7' assert_rails_does_not_boot diff --git a/railties/test/application/initializers/frameworks_test.rb b/railties/test/application/initializers/frameworks_test.rb index 196d121c14..446c85d65a 100644 --- a/railties/test/application/initializers/frameworks_test.rb +++ b/railties/test/application/initializers/frameworks_test.rb @@ -10,6 +10,10 @@ module ApplicationTests FileUtils.rm_rf "#{app_path}/config/environments" end + def teardown + teardown_app + end + # AC & AM test "set load paths set only if action controller or action mailer are in use" do assert_nothing_raised NameError do diff --git a/railties/test/application/initializers/hooks_test.rb b/railties/test/application/initializers/hooks_test.rb index 198abbe861..8c7726339c 100644 --- a/railties/test/application/initializers/hooks_test.rb +++ b/railties/test/application/initializers/hooks_test.rb @@ -10,6 +10,10 @@ module ApplicationTests FileUtils.rm_rf "#{app_path}/config/environments" end + def teardown + teardown_app + end + test "load initializers" do app_file "config/initializers/foo.rb", "$foo = true" require "#{app_path}/config/environment" diff --git a/railties/test/application/initializers/i18n_test.rb b/railties/test/application/initializers/i18n_test.rb index 390f65ab5c..8c2c079fb8 100644 --- a/railties/test/application/initializers/i18n_test.rb +++ b/railties/test/application/initializers/i18n_test.rb @@ -11,6 +11,10 @@ module ApplicationTests require "rails/all" end + def teardown + teardown_app + end + def load_app require "#{app_path}/config/environment" end @@ -48,7 +52,7 @@ module ApplicationTests end test "locale files should be added to the load path" do - app_file "config/another_locale.yml", "" + app_file "config/another_locale.yml", "en:\nfoo: ~" add_to_config <<-RUBY config.i18n.load_path << config.root.join("config/another_locale.yml").to_s @@ -127,7 +131,7 @@ en: # Fallbacks test "not using config.i18n.fallbacks does not initialize I18n.fallbacks" do - I18n.backend = Class.new { include I18n::Backend::Base }.new + I18n.backend = Class.new(I18n::Backend::Simple).new load_app assert_no_fallbacks end @@ -141,7 +145,7 @@ en: test "config.i18n.fallbacks = true initializes I18n.fallbacks with default settings even when backend changes" do I18n::Railtie.config.i18n.fallbacks = true - I18n::Railtie.config.i18n.backend = Class.new { include I18n::Backend::Base }.new + I18n::Railtie.config.i18n.backend = Class.new(I18n::Backend::Simple).new load_app assert I18n.backend.class.included_modules.include?(I18n::Backend::Fallbacks) assert_fallbacks :de => [:de, :en] diff --git a/railties/test/application/initializers/load_path_test.rb b/railties/test/application/initializers/load_path_test.rb index 714d62311d..644b8208a9 100644 --- a/railties/test/application/initializers/load_path_test.rb +++ b/railties/test/application/initializers/load_path_test.rb @@ -10,6 +10,10 @@ module ApplicationTests FileUtils.rm_rf "#{app_path}/config/environments" end + def teardown + teardown_app + end + test "initializing an application adds the application paths to the load path" do add_to_config <<-RUBY config.root = "#{app_path}" diff --git a/railties/test/application/initializers/notifications_test.rb b/railties/test/application/initializers/notifications_test.rb index c87433db0d..b72c14eaf0 100644 --- a/railties/test/application/initializers/notifications_test.rb +++ b/railties/test/application/initializers/notifications_test.rb @@ -9,6 +9,10 @@ module ApplicationTests boot_rails end + def teardown + teardown_app + end + def instrument(*args, &block) ActiveSupport::Notifications.instrument(*args, &block) end |