Sha256: ec2ff721ba50eed7b4db7257f237cc4721c3dd57cd61bbd7386f12436fdb2f84

Contents?: true

Size: 493 Bytes

Versions: 4

Compression:

Stored size: 493 Bytes

Contents

require 'stringio'
require 'zlib'

describe "Zlib::GzipFile#comment" do
  before :each do
    @io = StringIO.new
  end

  it "returns the name" do
    Zlib::GzipWriter.wrap @io do |gzio|
      gzio.comment = 'name'

      gzio.comment.should == 'name'
    end
  end

  it "raises an error on a closed stream" do
    Zlib::GzipWriter.wrap @io do |gzio|
      gzio.close

      lambda { gzio.comment }.should \
        raise_error(Zlib::GzipFile::Error, 'closed gzip stream')
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubysl-zlib-1.0.1 spec/gzipfile/comment_spec.rb
rubysl-zlib-2.0.1 spec/gzipfile/comment_spec.rb
rubysl-zlib-1.0.0 spec/gzipfile/comment_spec.rb
rubysl-zlib-2.0.0 spec/gzipfile/comment_spec.rb