Sha256: f8c4dc104b0f5b4167fe1df828fa10318a818ba11c262013aeb19c53dd8b7a23

Contents?: true

Size: 501 Bytes

Versions: 4

Compression:

Stored size: 501 Bytes

Contents

require 'stringio'
require 'zlib'

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

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

      gzio.orig_name.should == 'name'
    end
  end

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

      lambda { gzio.orig_name }.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/orig_name_spec.rb
rubysl-zlib-2.0.1 spec/gzipfile/orig_name_spec.rb
rubysl-zlib-1.0.0 spec/gzipfile/orig_name_spec.rb
rubysl-zlib-2.0.0 spec/gzipfile/orig_name_spec.rb