Sha256: d8895db6dcf9bf39b4a13c2de51b017e863e6723f7784cdd381c3dd798c22671

Contents?: true

Size: 890 Bytes

Versions: 1

Compression:

Stored size: 890 Bytes

Contents

require_relative '../test-util'

shared "archiver" do
  it "should compress and uncompress" do
    Util::Zip.compress(@src, @archive)
    @archive.should.exist
    @archive.size.should > 0
    Util::Zip.uncompress(@archive, @dest)
    (@dest + "A").read.should == "A"
    (@dest + "B").read.should == "B"
    (@dest + "C/1").read.should == "C"
    (@dest + "D/2").read.should == "D"
    (@dest+ "E/1/2").read.should == "E"
  end
end

describe "Pione::Util::Zip" do
  def create_files(src)
    (src + "A").create("A")
    (src + "B").create("B")
    (src + "C/1").create("C")
    (src + "D/2").create("D")
    (src + "E/1/2").create("E")
  end

  describe "local -> local -> local" do
    before do
      @src = Location[Temppath.mkdir]
      create_files(@src)
      @archive = Location[Temppath.create]
      @dest = Location[Temppath.mkdir]
    end

    behaves_like "archiver"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pione-0.2.2 test/util/spec_zip.rb