diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-22 16:24:44 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-22 16:24:44 +0100 |
commit | 4ae79367277954bf6616151b03cbe0660808f9bd (patch) | |
tree | d34be77dce755b395e22a87df1b42861a0120344 /railties/test | |
parent | 02c5137eadbb3530033d919b7aebeb6f4f389b83 (diff) | |
download | rails-4ae79367277954bf6616151b03cbe0660808f9bd.tar.gz rails-4ae79367277954bf6616151b03cbe0660808f9bd.tar.bz2 rails-4ae79367277954bf6616151b03cbe0660808f9bd.zip |
Got tests working once again.
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/configuration_test.rb | 4 | ||||
-rw-r--r-- | railties/test/initializer/path_test.rb | 23 | ||||
-rw-r--r-- | railties/test/paths_test.rb | 7 |
3 files changed, 11 insertions, 23 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 2c842eb096..6968e87986 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -34,9 +34,9 @@ module ApplicationTests add_to_config <<-RUBY config.root = '#{new_app}' RUBY - + use_frameworks [] - + require "#{app_path}/config/environment" assert_equal Pathname.new(new_app), Rails.application.root end diff --git a/railties/test/initializer/path_test.rb b/railties/test/initializer/path_test.rb index 328dda6d2c..76eb29bdf4 100644 --- a/railties/test/initializer/path_test.rb +++ b/railties/test/initializer/path_test.rb @@ -8,6 +8,7 @@ module InitializerTests build_app boot_rails FileUtils.rm_rf("#{app_path}/config/environments") + app_file "config/environments/development.rb", "" add_to_config <<-RUBY config.root = "#{app_path}" config.after_initialize do @@ -36,11 +37,8 @@ module InitializerTests end test "booting up Rails yields a valid paths object" do - assert_path @paths.app, "app" assert_path @paths.app.metals, "app", "metal" - assert_path @paths.app.models, "app", "models" - assert_path @paths.app.helpers, "app", "helpers" - assert_path @paths.app.services, "app", "services" + assert_path @paths.app.views, "app", "views" assert_path @paths.lib, "lib" assert_path @paths.vendor, "vendor" assert_path @paths.vendor.plugins, "vendor", "plugins" @@ -48,7 +46,7 @@ module InitializerTests assert_path @paths.tmp.cache, "tmp", "cache" assert_path @paths.config, "config" assert_path @paths.config.locales, "config", "locales" - assert_path @paths.config.environments, "config", "environments" + assert_path @paths.config.environment, "config", "environments", "development.rb" assert_equal root("app", "controllers"), @paths.app.controllers.to_a.first assert_equal Pathname.new(File.dirname(__FILE__)).join("..", "..", "builtin", "rails_info").expand_path, @@ -56,27 +54,22 @@ module InitializerTests end test "booting up Rails yields a list of paths that are eager" do - assert @paths.app.models.eager_load? + assert @paths.app.eager_load? assert @paths.app.controllers.eager_load? - assert @paths.app.helpers.eager_load? assert @paths.app.metals.eager_load? end test "environments has a glob equal to the current environment" do - assert_equal "#{Rails.env}.rb", @paths.config.environments.glob + assert_equal "#{Rails.env}.rb", @paths.config.environment.glob end test "load path includes each of the paths in config.paths as long as the directories exist" do - assert_in_load_path "app" assert_in_load_path "app", "controllers" assert_in_load_path "app", "models" assert_in_load_path "app", "helpers" assert_in_load_path "lib" assert_in_load_path "vendor" - assert_not_in_load_path "app", "views" - assert_not_in_load_path "app", "metal" - assert_not_in_load_path "app", "services" assert_not_in_load_path "config" assert_not_in_load_path "config", "locales" assert_not_in_load_path "config", "environments" @@ -86,17 +79,17 @@ module InitializerTests test "controller paths include builtin in development mode" do Rails.env.replace "development" - assert Rails::Configuration.new.paths.app.controllers.paths.any? { |p| p =~ /builtin/ } + assert Rails::Configuration.new("/").paths.app.controllers.paths.any? { |p| p =~ /builtin/ } end test "controller paths does not have builtin_directories in test mode" do Rails.env.replace "test" - assert !Rails::Configuration.new.paths.app.controllers.paths.any? { |p| p =~ /builtin/ } + assert !Rails::Configuration.new("/").paths.app.controllers.paths.any? { |p| p =~ /builtin/ } end test "controller paths does not have builtin_directories in production mode" do Rails.env.replace "production" - assert !Rails::Configuration.new.paths.app.controllers.paths.any? { |p| p =~ /builtin/ } + assert !Rails::Configuration.new("/").paths.app.controllers.paths.any? { |p| p =~ /builtin/ } end end diff --git a/railties/test/paths_test.rb b/railties/test/paths_test.rb index d60d6177f6..001282bb0d 100644 --- a/railties/test/paths_test.rb +++ b/railties/test/paths_test.rb @@ -193,12 +193,7 @@ class PathsTest < ActiveSupport::TestCase assert_equal 2, @root.eager_load.size end - test "a path should have a glob that defaults to **/*.rb" do - @root.app = "/app" - assert_equal "**/*.rb", @root.app.glob - end - - test "it should be possible to override a path's default glob" do + test "it should be possible to add a path's default glob" do @root.app = "/app" @root.app.glob = "*.rb" assert_equal "*.rb", @root.app.glob |