Skip to content

Commit

Permalink
fixes app_rails_loader_test.rb in Mac OS X
Browse files Browse the repository at this point in the history
  • Loading branch information
fxn committed Apr 11, 2013
1 parent 8bb8ba1 commit 2e3f519
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion railties/test/app_rails_loader_test.rb
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'
Expand All @@ -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
Expand Down Expand Up @@ -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.

Copy link
@rubys

rubys Apr 11, 2013

Contributor

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)

This comment has been minimized.

Copy link
@fxn

fxn Apr 11, 2013

Author Member

Nahh, braces are optional with ivars. Was not aware of that method may revise thanks!

end
end
end
Expand Down

0 comments on commit 2e3f519

Please sign in to comment.