Permalink
Browse files

Ruby 1.9: don't rely on . in load path

  • Loading branch information...
1 parent 43d2cb8 commit b92ff78df60ca76d810a85767ff12a33a4535127 @jeremy jeremy committed Dec 6, 2009
@@ -1,6 +1,6 @@
require 'abstract_unit'
require 'initializer'
-require "#{File.dirname(__FILE__)}/../environments/boot"
+require File.expand_path('../../environments/boot', __FILE__)
class BootTest < Test::Unit::TestCase
def test_boot_returns_if_booted
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/generator_test_helper'
+require File.expand_path('../generator_test_helper', __FILE__)
class RailsHelperGeneratorTest < GeneratorTestCase
def test_helper_generates_helper
@@ -180,7 +180,7 @@ def assert_framework_path(path)
end
end
-require File.dirname(__FILE__) + '/plugin_test_helper'
+require 'plugin_test_helper'
class InitializerPluginLoadingTests < Test::Unit::TestCase
def setup
@@ -27,12 +27,12 @@ class InstanceTag; end
# Must set before requiring generator libs.
if defined?(RAILS_ROOT)
- RAILS_ROOT.replace "#{File.dirname(__FILE__)}/fixtures"
+ RAILS_ROOT.replace File.expand_path('../fixtures', __FILE__)
else
- RAILS_ROOT = "#{File.dirname(__FILE__)}/fixtures"
+ RAILS_ROOT = File.expand_path('../fixtures', __FILE__)
end
-$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"
+$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'initializer'
# Mocks out the configuration

0 comments on commit b92ff78

Please sign in to comment.