diff options
author | scott Chacon <schacon@agadorsparticus.corp.reactrix.com> | 2007-11-14 10:35:41 -0800 |
---|---|---|
committer | scott Chacon <schacon@agadorsparticus.corp.reactrix.com> | 2007-11-14 10:35:41 -0800 |
commit | f13dfdd5f53d590378245c000c38b39ca1870ad7 (patch) | |
tree | cb6a1a859f6281bfa4944c730bc5b055bb6e35e8 /tests | |
parent | 58dfeb340ff6d56e94ad58911c7426c827409c48 (diff) | |
download | third_party-ruby-git-f13dfdd5f53d590378245c000c38b39ca1870ad7.tar.gz third_party-ruby-git-f13dfdd5f53d590378245c000c38b39ca1870ad7.tar.xz third_party-ruby-git-f13dfdd5f53d590378245c000c38b39ca1870ad7.zip |
updated the unit test to look at some of the archive files
Diffstat (limited to 'tests')
-rw-r--r-- | tests/units/test_archive.rb | 13 |
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') |