aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2017-05-26 12:24:43 +0930
committerGitHub <noreply@github.com>2017-05-26 12:24:43 +0930
commit4cfcf1ee542706c92c6c9b2e973e81b673fb220f (patch)
tree3bd9ec449ab553c73f34ec018f5450938b6831c7 /actionview/test/template
parent881823176a3fcaa3711900f2cdfd66b11a6df18a (diff)
parent40bdbce191ad90dfea43dad51fac5c4726b89392 (diff)
downloadrails-4cfcf1ee542706c92c6c9b2e973e81b673fb220f.tar.gz
rails-4cfcf1ee542706c92c6c9b2e973e81b673fb220f.tar.bz2
rails-4cfcf1ee542706c92c6c9b2e973e81b673fb220f.zip
Merge pull request #29176 from bogdanvlviv/define-path-with__dir__
Define path with __dir__
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