Sha256: 1788469abe21eb109c8a43b3132a2aa4c12e8fcce2e9edfc20e0fb94dd29adac

Contents?: true

Size: 800 Bytes

Versions: 18

Compression:

Stored size: 800 Bytes

Contents

require 'test_helper'

class FileSystemTest < Test::Unit::TestCase
  include Liquid

  def test_default
    assert_raise(FileSystemError) do
      BlankFileSystem.new.read_template_file("dummy", {'dummy'=>'smarty'})
    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")

    assert_raise(FileSystemError) do
      file_system.full_path("../dir/mypartial")
    end

    assert_raise(FileSystemError) do
      file_system.full_path("/dir/../../dir/mypartial")
    end

    assert_raise(FileSystemError) do
      file_system.full_path("/etc/passwd")
    end
  end
end # FileSystemTest

Version data entries

18 entries across 18 versions & 4 rubygems

Version Path
liquid-2.6.3 test/liquid/file_system_test.rb
liquid-2.6.2 test/liquid/file_system_test.rb
liquid-2.6.1 test/liquid/file_system_test.rb
liquid-2.5.5 test/liquid/file_system_test.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/liquid-2.6.0/test/liquid/file_system_test.rb
liquid-2.6.0 test/liquid/file_system_test.rb
liquid-2.5.4 test/liquid/file_system_test.rb
liquid-2.6.0.rc1 test/liquid/file_system_test.rb
liquid-2.5.3 test/liquid/file_system_test.rb
liquid-2.5.1 test/liquid/file_system_test.rb
wordify_liquid-2.5.1 test/liquid/file_system_test.rb
liquid-2.5.0 test/liquid/file_system_test.rb
liquid-2.4.1 test/liquid/file_system_test.rb
liquid-2.4.0 test/liquid/file_system_test.rb
spinto-liquid-2.3.0.3 test/liquid/file_system_test.rb
spinto-liquid-2.3.0.2 test/liquid/file_system_test.rb
spinto-liquid-2.3.0.1 test/liquid/file_system_test.rb
liquid-2.3.0 test/liquid/file_system_test.rb