Commit 3ce6bc90 authored by tmaruyama's avatar tmaruyama

scm: filesystem: update test repository for non ascii text files displaying (#6256).

git-svn-id: https://svn.redmine.org/redmine/trunk@5203 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 2377383e
......@@ -11,16 +11,16 @@ class FilesystemAdapterTest < ActiveSupport::TestCase
end
def test_entries
assert_equal 2, @adapter.entries.size
assert_equal ["dir", "test"], @adapter.entries.collect(&:name)
assert_equal ["dir", "test"], @adapter.entries(nil).collect(&:name)
assert_equal ["dir", "test"], @adapter.entries("/").collect(&:name)
assert_equal 3, @adapter.entries.size
assert_equal ["dir", "japanese", "test"], @adapter.entries.collect(&:name)
assert_equal ["dir", "japanese", "test"], @adapter.entries(nil).collect(&:name)
assert_equal ["dir", "japanese", "test"], @adapter.entries("/").collect(&:name)
["dir", "/dir", "/dir/", "dir/"].each do |path|
assert_equal ["subdir", "dirfile"], @adapter.entries(path).collect(&:name)
end
# If y try to use "..", the path is ignored
["/../","dir/../", "..", "../", "/..", "dir/.."].each do |path|
assert_equal ["dir", "test"], @adapter.entries(path).collect(&:name),
assert_equal ["dir", "japanese", "test"], @adapter.entries(path).collect(&:name),
".. must be ignored in path argument"
end
end
......
......@@ -40,7 +40,7 @@ class RepositoryFilesystemTest < ActiveSupport::TestCase
end
def test_entries
assert_equal 2, @repository.entries("", 2).size
assert_equal 3, @repository.entries("", 2).size
assert_equal 2, @repository.entries("dir", 3).size
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment