-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chris Gibson
authored and
Chris
committed
Dec 16, 2009
1 parent
9eaf2f1
commit 08267d1
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require "pathname" | ||
require Pathname(__FILE__).dirname + "helper" | ||
# require Pathname(__FILE__).dirname.parent + "harbor" + "zipped_io" | ||
|
||
class ZippedIOTest < Test::Unit::TestCase | ||
|
||
def setup | ||
end | ||
|
||
def teardown | ||
end | ||
|
||
def test_create_a_simple_zip_file | ||
file = Harbor::File.new(Pathname(__FILE__).dirname + "samples" + "volcanoUPI_800x531.jpg") | ||
file2 = Harbor::File.new(Pathname(__FILE__).dirname + "application_test.rb") | ||
zip = Harbor::ZippedIO.new([file, file2]) | ||
size = zip.size | ||
puts "Size: #{size}" | ||
::File.open("/tmp/ziptest_#{`uuidgen`.chomp}.zip", "w") do |file| | ||
zip.each do |data| | ||
file.write(data) | ||
end | ||
end | ||
end | ||
|
||
end |