diff options
author | José Valim <jose.valim@gmail.com> | 2009-07-02 10:25:18 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-07-02 10:25:18 +0200 |
commit | 1c265da1db934ffab0a5151dc7beeed3ef1bbabb (patch) | |
tree | e3e2af724e0fe70b9bceb09a26a179fadf76b992 /railties/test | |
parent | 4739f0ff5d5c013eb33aed7f371a3a91d3fca292 (diff) | |
parent | 8bb510f6c1e235f5fb1cf9e79af759a429a497b0 (diff) | |
download | rails-1c265da1db934ffab0a5151dc7beeed3ef1bbabb.tar.gz rails-1c265da1db934ffab0a5151dc7beeed3ef1bbabb.tar.bz2 rails-1c265da1db934ffab0a5151dc7beeed3ef1bbabb.zip |
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/abstract_unit.rb | 5 | ||||
-rw-r--r-- | railties/test/initializer/path_test.rb | 17 | ||||
-rw-r--r-- | railties/test/paths_test.rb | 7 |
3 files changed, 26 insertions, 3 deletions
diff --git a/railties/test/abstract_unit.rb b/railties/test/abstract_unit.rb index cef69e90cb..9a640bdbc5 100644 --- a/railties/test/abstract_unit.rb +++ b/railties/test/abstract_unit.rb @@ -1,3 +1,5 @@ +ORIG_ARGV = ARGV.dup + $:.unshift File.dirname(__FILE__) + "/../../activesupport/lib" $:.unshift File.dirname(__FILE__) + "/../../activerecord/lib" $:.unshift File.dirname(__FILE__) + "/../../actionpack/lib" @@ -10,9 +12,6 @@ require 'stringio' require 'rubygems' require 'test/unit' -gem 'mocha', '>= 0.9.5' -require 'mocha' - require 'active_support' require 'active_support/test_case' diff --git a/railties/test/initializer/path_test.rb b/railties/test/initializer/path_test.rb index 37e1eebbc7..8fbad24a73 100644 --- a/railties/test/initializer/path_test.rb +++ b/railties/test/initializer/path_test.rb @@ -14,6 +14,8 @@ Rails::Initializer.run do |config| end class PathsTest < ActiveSupport::TestCase + include ActiveSupport::Testing::Isolation + def setup @paths = Rails::Initializer.default.config.paths end @@ -83,4 +85,19 @@ class PathsTest < ActiveSupport::TestCase assert_not_in_load_path "tmp", "cache" end + 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/ } + 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/ } + 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/ } + end + end
\ No newline at end of file diff --git a/railties/test/paths_test.rb b/railties/test/paths_test.rb index a1ed43ad6d..fa2f6ceee2 100644 --- a/railties/test/paths_test.rb +++ b/railties/test/paths_test.rb @@ -52,6 +52,12 @@ class PathsTest < ActiveSupport::TestCase assert_equal ["/app", "/app2"], @root.app.to_a end + test "adding multiple physical paths using concat" do + @root.app = "/app" + @root.app.concat ["/app2", "/app3"] + assert_equal ["/app", "/app2", "/app3"], @root.app.to_a + end + test "adding multiple physical paths using #unshift" do @root.app = "/app" @root.app.unshift "/app2" @@ -62,6 +68,7 @@ class PathsTest < ActiveSupport::TestCase assert_raise(RuntimeError) { Rails::Application::Root.new(["/fiz", "/biz"]) } assert_raise(NoMethodError) { @root.push "/biz" } assert_raise(NoMethodError) { @root.unshift "/biz" } + assert_raise(NoMethodError) { @root.concat ["/biz"]} assert_raise(NoMethodError) { @root << "/biz" } end |