aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorbogdanvlviv <bogdanvlviv@gmail.com>2017-06-11 15:59:23 +0300
committerbogdanvlviv <bogdanvlviv@gmail.com>2017-06-14 12:10:17 +0300
commit6673cf7071094e87d473459452a2d0e4c2ccfebe (patch)
tree926d5c944b8fd71c1fa2db6ddbc5fc397722112e /railties/test
parent326914dd3a15e04851c9ef4a47edeb3dad2ec381 (diff)
downloadrails-6673cf7071094e87d473459452a2d0e4c2ccfebe.tar.gz
rails-6673cf7071094e87d473459452a2d0e4c2ccfebe.tar.bz2
rails-6673cf7071094e87d473459452a2d0e4c2ccfebe.zip
Use `require_relative` instead of `require` with full path
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/generators/plugin_generator_test.rb6
-rw-r--r--railties/test/generators_test.rb2
2 files changed, 4 insertions, 4 deletions
diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb
index af16a2641a..63aa079a12 100644
--- a/railties/test/generators/plugin_generator_test.rb
+++ b/railties/test/generators/plugin_generator_test.rb
@@ -63,7 +63,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase
assert_no_file "config/routes.rb"
assert_no_file "app/assets/config/bukkits_manifest.js"
assert_file "test/test_helper.rb" do |content|
- assert_match(/require.+test\/dummy\/config\/environment/, content)
+ assert_match(/require_relative.+test\/dummy\/config\/environment/, content)
assert_match(/ActiveRecord::Migrator\.migrations_paths.+test\/dummy\/db\/migrate/, content)
assert_match(/Minitest\.backtrace_filter = Minitest::BacktraceFilter\.new/, content)
assert_match(/Rails::TestUnitReporter\.executable = 'bin\/test'/, content)
@@ -438,7 +438,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase
assert_file "spec/dummy/config/application.rb"
assert_no_file "test/dummy"
assert_file "test/test_helper.rb" do |content|
- assert_match(/require.+spec\/dummy\/config\/environment/, content)
+ assert_match(/require_relative.+spec\/dummy\/config\/environment/, content)
assert_match(/ActiveRecord::Migrator\.migrations_paths.+spec\/dummy\/db\/migrate/, content)
end
end
@@ -449,7 +449,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase
assert_file "spec/fake/config/application.rb"
assert_no_file "test/dummy"
assert_file "test/test_helper.rb" do |content|
- assert_match(/require.+spec\/fake\/config\/environment/, content)
+ assert_match(/require_relative.+spec\/fake\/config\/environment/, content)
assert_match(/ActiveRecord::Migrator\.migrations_paths.+spec\/fake\/db\/migrate/, content)
end
end
diff --git a/railties/test/generators_test.rb b/railties/test/generators_test.rb
index b784446535..e07627f36d 100644
--- a/railties/test/generators_test.rb
+++ b/railties/test/generators_test.rb
@@ -233,7 +233,7 @@ class GeneratorsTest < Rails::Generators::TestCase
end
def test_usage_with_embedded_ruby
- require File.expand_path("fixtures/lib/generators/usage_template/usage_template_generator", __dir__)
+ require_relative "fixtures/lib/generators/usage_template/usage_template_generator"
output = capture(:stdout) { Rails::Generators.invoke :usage_template, ["--help"] }
assert_match(/:: 2 ::/, output)
end