From 6673cf7071094e87d473459452a2d0e4c2ccfebe Mon Sep 17 00:00:00 2001
From: bogdanvlviv <bogdanvlviv@gmail.com>
Date: Sun, 11 Jun 2017 15:59:23 +0300
Subject: Use `require_relative` instead of `require` with full path

---
 railties/lib/rails/generators/rails/app/templates/test/test_helper.rb   | 2 +-
 .../lib/rails/generators/rails/plugin/templates/test/test_helper.rb     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

(limited to 'railties/lib')

diff --git a/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb b/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb
index 7568af5b5e..6ad1f11781 100644
--- a/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb
+++ b/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb
@@ -1,4 +1,4 @@
-require File.expand_path('../config/environment', __dir__)
+require_relative '../config/environment'
 require 'rails/test_help'
 
 class ActiveSupport::TestCase
diff --git a/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb b/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb
index 32e8202e1c..c281fc42ca 100644
--- a/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb
+++ b/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb
@@ -1,4 +1,4 @@
-require File.expand_path("../<%= options[:dummy_path] -%>/config/environment.rb", __dir__)
+require_relative "<%= File.join('..', options[:dummy_path], 'config/environment') -%>"
 <% unless options[:skip_active_record] -%>
 ActiveRecord::Migrator.migrations_paths = [File.expand_path("../<%= options[:dummy_path] -%>/db/migrate", __dir__)]
 <% if options[:mountable] -%>
-- 
cgit v1.2.3