aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2013-04-11 15:18:34 +0200
committerXavier Noria <fxn@hashref.com>2013-04-11 15:22:59 +0200
commit2e3f5191f05dbd072194bf47564a51bfa4cbf0d5 (patch)
tree81d6d045cfd31da73d9f3ad6c53a3e18321c647b /railties
parent8bb8ba127b6319c089487e40cb57a0c03c5830e5 (diff)
downloadrails-2e3f5191f05dbd072194bf47564a51bfa4cbf0d5.tar.gz
rails-2e3f5191f05dbd072194bf47564a51bfa4cbf0d5.tar.bz2
rails-2e3f5191f05dbd072194bf47564a51bfa4cbf0d5.zip
fixes app_rails_loader_test.rb in Mac OS X
Diffstat (limited to 'railties')
-rw-r--r--railties/test/app_rails_loader_test.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/railties/test/app_rails_loader_test.rb b/railties/test/app_rails_loader_test.rb
index 12e5558915..a16b8d3302 100644
--- a/railties/test/app_rails_loader_test.rb
+++ b/railties/test/app_rails_loader_test.rb
@@ -1,3 +1,4 @@
+require 'tmpdir'
require 'pathname'
require 'abstract_unit'
require 'rails/app_rails_loader'
@@ -12,6 +13,10 @@ class AppRailsLoaderTest < ActiveSupport::TestCase
Rails::AppRailsLoader.expects(:exec).with(Rails::AppRailsLoader::RUBY, exe)
end
+ def realpath(filename)
+ Pathname.new(filename).realpath
+ end
+
setup do
@tmp = Dir.mktmpdir('railties-rails-loader-test-suite')
@cwd = Dir.pwd
@@ -50,7 +55,13 @@ class AppRailsLoaderTest < ActiveSupport::TestCase
expects_exec exe
Rails::AppRailsLoader.exec_app_rails
- assert_equal File.join(@tmp, 'foo'), Dir.pwd
+
+ # Compare the realpath in case either of them has symlinks.
+ #
+ # This happens in particular in Mac OS X, where @tmp starts
+ # with "/var", and Dir.pwd with "/private/var", due to a
+ # default system symlink var -> private/var.
+ assert_equal realpath("#@tmp/foo"), realpath(Dir.pwd)
end
end
end