-
Notifications
You must be signed in to change notification settings - Fork 21.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes app_rails_loader_test.rb in Mac OS X
- Loading branch information
Showing
1 changed file
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
require 'tmpdir' | ||
require 'pathname' | ||
require 'abstract_unit' | ||
require 'rails/app_rails_loader' | ||
|
@@ -12,6 +13,10 @@ def expects_exec(exe) | |
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 @@ def expects_exec(exe) | |
|
||
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) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
fxn
Author
Member
|
||
end | ||
end | ||
end | ||
|
Missing braces?
"#{@tmp}/foo"
Also Ruby 1.9.3 and Ruby 2.0.0 have a File.realpath. (Ruby 1.8.7 does not, but is no longer relevant to Rails 4)