more tree_map tests
This commit is contained in:
@@ -43,6 +43,10 @@ module Gollum
|
|||||||
page
|
page
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def inspect
|
||||||
|
%(#<Gollum::BlobEntry #{@sha} #{@path}>)
|
||||||
|
end
|
||||||
|
|
||||||
# Normalizes a given directory name for searching through tree paths.
|
# Normalizes a given directory name for searching through tree paths.
|
||||||
# Ensures that a directory begins with a slash, or
|
# Ensures that a directory begins with a slash, or
|
||||||
#
|
#
|
||||||
|
|||||||
+7
-2
@@ -64,8 +64,13 @@ context "Wiki" do
|
|||||||
@wiki.tree_map_for 'master'
|
@wiki.tree_map_for 'master'
|
||||||
assert_equal({"master"=>"60f12f4254f58801b9ee7db7bca5fa8aeefaa56b"}, @wiki.ref_map)
|
assert_equal({"master"=>"60f12f4254f58801b9ee7db7bca5fa8aeefaa56b"}, @wiki.ref_map)
|
||||||
|
|
||||||
entry = @wiki.tree_map['60f12f4254f58801b9ee7db7bca5fa8aeefaa56b'][0]
|
map = @wiki.tree_map['60f12f4254f58801b9ee7db7bca5fa8aeefaa56b']
|
||||||
assert_equal 'Bilbo-Baggins.md', entry.path
|
assert_equal 'Bilbo-Baggins.md', map[0].path
|
||||||
|
assert_equal '', map[0].dir
|
||||||
|
assert_equal map[0].path, map[0].name
|
||||||
|
assert_equal 'Mordor/Eye-Of-Sauron.md', map[3].path
|
||||||
|
assert_equal '/Mordor', map[3].dir
|
||||||
|
assert_equal 'Eye-Of-Sauron.md', map[3].name
|
||||||
end
|
end
|
||||||
|
|
||||||
test "#tree_map_for only caches tree for commit" do
|
test "#tree_map_for only caches tree for commit" do
|
||||||
|
|||||||
Reference in New Issue
Block a user