summaryrefslogtreecommitdiffstats
path: root/tests/units
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units')
-rw-r--r--tests/units/test_archive.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/units/test_archive.rb b/tests/units/test_archive.rb
index 8824f5f..efff94a 100644
--- a/tests/units/test_archive.rb
+++ b/tests/units/test_archive.rb
@@ -22,7 +22,14 @@ class TestArchive < Test::Unit::TestCase
f = @git.object('v2.6').archive # returns path to temp file
assert(File.exists?(f))
-
+
+ f = @git.object('v2.6').archive(nil, :format => 'tar') # returns path to temp file
+ assert(File.exists?(f))
+
+ lines = `cd /tmp; tar xvpf #{f}`.split("\n")
+ assert_equal('ex_dir/', lines[0])
+ assert_equal('example.txt', lines[2])
+
f = @git.object('v2.6').archive(tempfile, :format => 'zip')
assert(File.file?(f))
@@ -31,6 +38,10 @@ class TestArchive < Test::Unit::TestCase
f = @git.object('v2.6').archive(tempfile, :format => 'tar', :prefix => 'test/', :path => 'ex_dir/')
assert(File.exists?(f))
+
+ lines = `cd /tmp; tar xvpf #{f}`.split("\n")
+ assert_equal('test/', lines[0])
+ assert_equal('test/ex_dir/ex.txt', lines[2])
in_temp_dir do
c = Git.clone(@wbare, 'new')