Skip to content

Commit

Permalink
Adding ZippedIO test
Browse files Browse the repository at this point in the history
  • 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.
26 changes: 26 additions & 0 deletions test/zipped_io_test.rb
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

0 comments on commit 08267d1

Please sign in to comment.