Commit 1e6faba0 authored by tmaruyama's avatar tmaruyama

scm: git: add entry test to unit lib test

git-svn-id: https://svn.redmine.org/redmine/trunk@10410 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 6daa9840
......@@ -487,6 +487,37 @@ begin
end
end
def test_entry
entry = @adapter.entry()
assert_equal "", entry.path
assert_equal "dir", entry.kind
entry = @adapter.entry('')
assert_equal "", entry.path
assert_equal "dir", entry.kind
assert_nil @adapter.entry('invalid')
assert_nil @adapter.entry('/invalid')
assert_nil @adapter.entry('/invalid/')
assert_nil @adapter.entry('invalid/invalid')
assert_nil @adapter.entry('invalid/invalid/')
assert_nil @adapter.entry('/invalid/invalid')
assert_nil @adapter.entry('/invalid/invalid/')
["README", "/README"].each do |path|
entry = @adapter.entry(path, '7234cb2750b63f')
assert_equal "README", entry.path
assert_equal "file", entry.kind
end
["sources", "/sources", "/sources/"].each do |path|
entry = @adapter.entry(path, '7234cb2750b63f')
assert_equal "sources", entry.path
assert_equal "dir", entry.kind
end
["sources/watchers_controller.rb", "/sources/watchers_controller.rb"].each do |path|
entry = @adapter.entry(path, '7234cb2750b63f')
assert_equal "sources/watchers_controller.rb", entry.path
assert_equal "file", entry.kind
end
end
def test_path_encoding_default_utf8
adpt1 = Redmine::Scm::Adapters::GitAdapter.new(
REPOSITORY_PATH
......
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