Permalink
Browse files

replaces Pathname#(dirname|realpath) with File.$1

Simpler, thanks to @rubys for the hint.
  • Loading branch information...
1 parent 3c55172 commit 481618cfc20faf980e0e238ffa1a9d192b51d00b @fxn fxn committed Apr 12, 2013
Showing with 2 additions and 7 deletions.
  1. +2 −7 railties/test/app_rails_loader_test.rb
@@ -1,22 +1,17 @@
require 'tmpdir'
-require 'pathname'
require 'abstract_unit'
require 'rails/app_rails_loader'
class AppRailsLoaderTest < ActiveSupport::TestCase
def write(filename, contents=nil)
- FileUtils.mkdir_p(Pathname.new(filename).dirname)
+ FileUtils.mkdir_p(File.dirname(filename))
File.write(filename, contents)
end
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
@@ -61,7 +56,7 @@ def realpath(filename)
# 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)
+ assert_equal File.realpath("#@tmp/foo"), File.realpath(Dir.pwd)
end
end
end

0 comments on commit 481618c

Please sign in to comment.