Sha256: f410460aacf28cce577eb22d877c434dd53e14a7b96face3dc63b76382f0be22

Contents?: true

Size: 1019 Bytes

Versions: 4

Compression:

Stored size: 1019 Bytes

Contents

# -*- encoding: US-ASCII -*-
require 'zlib'

describe "Zlib::Deflate#deflate" do

  before :each do
    @deflator = Zlib::Deflate.new
  end

  it "deflates some data" do
    data = "\000" * 10

    zipped = @deflator.deflate data, Zlib::FINISH
    @deflator.finish

    zipped.should == "x\234c`\200\001\000\000\n\000\001"
  end

  it "deflates lots of data" do
    data = "\000" * 32 * 1024

    zipped = @deflator.deflate data, Zlib::FINISH
    @deflator.finish

    zipped.should == "x\234\355\301\001\001\000\000\000\200\220\376\257\356\b\n#{"\000" * 31}\030\200\000\000\001"
  end

end

describe "Zlib::Deflate::deflate" do

  it "deflates some data" do
    data = "\000" * 10

    zipped = Zlib::Deflate.deflate data

    zipped.should == "x\234c`\200\001\000\000\n\000\001"
  end

  it "deflates lots of data" do
    data = "\000" * 32 * 1024

    zipped = Zlib::Deflate.deflate data

    zipped.should == "x\234\355\301\001\001\000\000\000\200\220\376\257\356\b\n#{"\000" * 31}\030\200\000\000\001"
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubysl-zlib-1.0.1 spec/deflate/deflate_spec.rb
rubysl-zlib-2.0.1 spec/deflate/deflate_spec.rb
rubysl-zlib-1.0.0 spec/deflate/deflate_spec.rb
rubysl-zlib-2.0.0 spec/deflate/deflate_spec.rb