Add basic support for symbolic links.

This commit is contained in:
Charles Pence
2013-03-16 18:19:48 -04:00
parent 44a3cf1934
commit 2a4517ced4
19 changed files with 98 additions and 12 deletions
+14
View File
@@ -21,6 +21,20 @@ context "File" do
assert_equal commit.author.name, file.version.author.name
end
test "symbolic link" do
commit = @wiki.repo.commits.first
file = @wiki.file("Data-Two.csv")
# Since we don't have a checkout here (bare repos in testing), these
# symbolic links won't resolve. Stub IO.read to simulate the behavior
# and make sure all is working well.
path_to_link = File.expand_path(File.join('..', '..', 'Data.csv'), __FILE__)
File.expects(:file?).with(path_to_link).returns(true)
IO.expects(:read).with(path_to_link).returns('symlink test')
assert_equal file.raw_data, 'symlink test'
end
test "accessing tree" do
assert_nil @wiki.file("Mordor")
end