mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
fixes app_rails_loader_test.rb in Mac OS X
This commit is contained in:
parent
8bb8ba127b
commit
2e3f5191f0
1 changed files with 12 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue