summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-08-10 23:26:09 -0400
committerPaul Duncan <pabs@pablotron.org>2016-08-10 23:26:09 -0400
commit82dafe047ec701ecd8d62c8088152fe2c4ab1a5d (patch)
treeb230848006cb10f35d2161be8af7f253c98dad84 /spec
parent59439a27a8ae5a5a9ed68022b3fe1d080abd7149 (diff)
downloadzip-crystal-82dafe047ec701ecd8d62c8088152fe2c4ab1a5d.tar.bz2
zip-crystal-82dafe047ec701ecd8d62c8088152fe2c4ab1a5d.zip
s/entry.read/entry.write/ and add Writers::DirEntry
Diffstat (limited to 'spec')
-rw-r--r--spec/zip_spec.cr7
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/zip_spec.cr b/spec/zip_spec.cr
index 6503a65..01a98ff 100644
--- a/spec/zip_spec.cr
+++ b/spec/zip_spec.cr
@@ -53,6 +53,7 @@ describe Zip do
zip.add("foo.txt", MemoryIO.new("foo"))
zip.add("bar.txt", "bar")
zip.add_file("test.cr", TEST_FILE_PATH)
+ zip.add_dir("example-dir")
end
end
@@ -79,7 +80,7 @@ describe Zip do
it "reads an archive created by an external program" do
Zip.read(File.join(TEST_DIR, "real.zip")) do |zip|
zip.each do |e|
- e.read(File.open("/dev/null", "wb"))
+ e.write("/dev/null")
# p e.extras.map { |e| { e.code, e.size } }
# p e.local_extras.map { |e| { e.code, e.size } }
@@ -93,8 +94,8 @@ describe Zip do
pp e.path
io = MemoryIO.new
- # e.read(STDOUT)
- e.read(io)
+ # e.write(STDOUT)
+ e.write(io)
io.close
end
end