Files
liquid/test/lib/liquid/file_system_test.rb
DBA c72c84ea9b Tests
- Organized the files
  - Cleaned up some of the white spacing issues
  - A lot can still be done to make the tests more readable to the new developers
2010-08-23 01:30:01 +08:00

30 lines
779 B
Ruby

require 'test_helper'
class FileSystemTest < Test::Unit::TestCase
include Liquid
def test_default
assert_raise(FileSystemError) do
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")
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