From f13dfdd5f53d590378245c000c38b39ca1870ad7 Mon Sep 17 00:00:00 2001 From: scott Chacon Date: Wed, 14 Nov 2007 10:35:41 -0800 Subject: updated the unit test to look at some of the archive files --- tests/units/test_archive.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'tests') 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') -- cgit