aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template
diff options
context:
space:
mode:
authorbogdanvlviv <bogdanvlviv@gmail.com>2017-05-15 14:17:28 +0000
committerbogdanvlviv <bogdanvlviv@gmail.com>2017-05-23 00:53:51 +0300
commit40bdbce191ad90dfea43dad51fac5c4726b89392 (patch)
treea6c6d8369874775cdc6cf1d4b90684490c0198bc /actionview/test/template
parentd414881a342d849d65810a037c0b1baff8538e41 (diff)
downloadrails-40bdbce191ad90dfea43dad51fac5c4726b89392.tar.gz
rails-40bdbce191ad90dfea43dad51fac5c4726b89392.tar.bz2
rails-40bdbce191ad90dfea43dad51fac5c4726b89392.zip
Define path with __dir__
".. with __dir__ we can restore order in the Universe." - by @fxn Related to 5b8738c2df003a96f0e490c43559747618d10f5f
Diffstat (limited to 'actionview/test/template')
-rw-r--r--actionview/test/template/digestor_test.rb2
-rw-r--r--actionview/test/template/render_test.rb4
-rw-r--r--actionview/test/template/resolver_patterns_test.rb2
3 files changed, 4 insertions, 4 deletions
diff --git a/actionview/test/template/digestor_test.rb b/actionview/test/template/digestor_test.rb
index e225c3de09..de04f3f25d 100644
--- a/actionview/test/template/digestor_test.rb
+++ b/actionview/test/template/digestor_test.rb
@@ -14,7 +14,7 @@ class FixtureTemplate
end
class FixtureFinder < ActionView::LookupContext
- FIXTURES_DIR = "#{File.dirname(__FILE__)}/../fixtures/digestor"
+ FIXTURES_DIR = File.expand_path("../fixtures/digestor", __dir__)
def initialize(details = {})
super(ActionView::PathSet.new(["digestor", "digestor/api"]), details, [])
diff --git a/actionview/test/template/render_test.rb b/actionview/test/template/render_test.rb
index fef78807d1..9999607067 100644
--- a/actionview/test/template/render_test.rb
+++ b/actionview/test/template/render_test.rb
@@ -138,7 +138,7 @@ module RenderTestCases
end
def test_render_file_with_full_path
- template_path = File.join(File.dirname(__FILE__), "../fixtures/test/hello_world")
+ template_path = File.expand_path("../fixtures/test/hello_world", __dir__)
assert_equal "Hello world!", @view.render(file: template_path)
end
@@ -160,7 +160,7 @@ module RenderTestCases
end
def test_render_outside_path
- assert File.exist?(File.join(File.dirname(__FILE__), "../../test/abstract_unit.rb"))
+ assert File.exist?(File.expand_path("../../test/abstract_unit.rb", __dir__))
assert_raises ActionView::MissingTemplate do
@view.render(template: "../\\../test/abstract_unit.rb")
end
diff --git a/actionview/test/template/resolver_patterns_test.rb b/actionview/test/template/resolver_patterns_test.rb
index 43e3f21076..8e21f4b828 100644
--- a/actionview/test/template/resolver_patterns_test.rb
+++ b/actionview/test/template/resolver_patterns_test.rb
@@ -2,7 +2,7 @@ require "abstract_unit"
class ResolverPatternsTest < ActiveSupport::TestCase
def setup
- path = File.expand_path("../../fixtures/", __FILE__)
+ path = File.expand_path("../fixtures", __dir__)
pattern = ":prefix/{:formats/,}:action{.:formats,}{+:variants,}{.:handlers,}"
@resolver = ActionView::FileSystemResolver.new(path, pattern)
end