aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/app_rails_loader_test.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2013-04-12 02:31:23 +0200
committerXavier Noria <fxn@hashref.com>2013-04-12 02:33:46 +0200
commit481618cfc20faf980e0e238ffa1a9d192b51d00b (patch)
tree1651661e06627990152740bc8e2a82c796e011d5 /railties/test/app_rails_loader_test.rb
parent3c5517237fb046db3872d77f764e2168f31a5848 (diff)
downloadrails-481618cfc20faf980e0e238ffa1a9d192b51d00b.tar.gz
rails-481618cfc20faf980e0e238ffa1a9d192b51d00b.tar.bz2
rails-481618cfc20faf980e0e238ffa1a9d192b51d00b.zip
replaces Pathname#(dirname|realpath) with File.$1
Simpler, thanks to @rubys for the hint.
Diffstat (limited to 'railties/test/app_rails_loader_test.rb')
-rw-r--r--railties/test/app_rails_loader_test.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/railties/test/app_rails_loader_test.rb b/railties/test/app_rails_loader_test.rb
index a16b8d3302..ceae78ae80 100644
--- a/railties/test/app_rails_loader_test.rb
+++ b/railties/test/app_rails_loader_test.rb
@@ -1,11 +1,10 @@
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
@@ -13,10 +12,6 @@ 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
@@ -61,7 +56,7 @@ class AppRailsLoaderTest < ActiveSupport::TestCase
# 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