Fix invalid box test by not relying on Archive;:Tar::Minitar

This commit is contained in:
Mitchell Hashimoto 2013-01-29 11:10:44 -08:00
parent 948a31d7b3
commit 3399b74163
1 changed files with 0 additions and 6 deletions

View File

@ -2,7 +2,6 @@ require File.expand_path("../../base", __FILE__)
require "pathname" require "pathname"
require 'tempfile' require 'tempfile'
require 'archive/tar/minitar'
describe Vagrant::BoxCollection do describe Vagrant::BoxCollection do
include_context "unit" include_context "unit"
@ -112,11 +111,6 @@ describe Vagrant::BoxCollection do
CHECKSUM_LENGTH = 8 CHECKSUM_LENGTH = 8
Tempfile.new(['vagrant_testing', '.tar']) do |f| Tempfile.new(['vagrant_testing', '.tar']) do |f|
# Create a temp tar file
Archive::Tar::Minitar.pack('test', f)
# Minitar closes the Tempfile so reopen it
f = File.open(f.path, "wb")
# Corrupt the tar by writing over the checksum field # Corrupt the tar by writing over the checksum field
f.seek(CHECKSUM_OFFSET) f.seek(CHECKSUM_OFFSET)
f.write("\0"*CHECKSUM_LENGTH) f.write("\0"*CHECKSUM_LENGTH)