Upgrade rubocop

This commit is contained in:
Mike Angell
2019-08-27 17:46:09 +10:00
parent 831355dfbd
commit da9051eb18
121 changed files with 2736 additions and 1872 deletions
+12 -10
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'test_helper'
class FileSystemUnitTest < Minitest::Test
@@ -5,31 +7,31 @@ class FileSystemUnitTest < Minitest::Test
def test_default
assert_raises(FileSystemError) do
BlankFileSystem.new.read_template_file("dummy")
BlankFileSystem.new.read_template_file('dummy')
end
end
def test_local
file_system = Liquid::LocalFileSystem.new("/some/path")
assert_equal "/some/path/_mypartial.liquid", file_system.full_path("mypartial")
assert_equal "/some/path/dir/_mypartial.liquid", file_system.full_path("dir/mypartial")
file_system = Liquid::LocalFileSystem.new('/some/path')
assert_equal '/some/path/_mypartial.liquid', file_system.full_path('mypartial')
assert_equal '/some/path/dir/_mypartial.liquid', file_system.full_path('dir/mypartial')
assert_raises(FileSystemError) do
file_system.full_path("../dir/mypartial")
file_system.full_path('../dir/mypartial')
end
assert_raises(FileSystemError) do
file_system.full_path("/dir/../../dir/mypartial")
file_system.full_path('/dir/../../dir/mypartial')
end
assert_raises(FileSystemError) do
file_system.full_path("/etc/passwd")
file_system.full_path('/etc/passwd')
end
end
def test_custom_template_filename_patterns
file_system = Liquid::LocalFileSystem.new("/some/path", "%s.html")
assert_equal "/some/path/mypartial.html", file_system.full_path("mypartial")
assert_equal "/some/path/dir/mypartial.html", file_system.full_path("dir/mypartial")
file_system = Liquid::LocalFileSystem.new('/some/path', '%s.html')
assert_equal '/some/path/mypartial.html', file_system.full_path('mypartial')
assert_equal '/some/path/dir/mypartial.html', file_system.full_path('dir/mypartial')
end
end # FileSystemTest