summaryrefslogtreecommitdiff
path: root/spec/ruby/library/zlib/gzipreader/mtime_spec.rb
blob: e8e71fa72e4d44862125bb51905925ff155b41ea (plain)
1
2
3
4
5
6
7
8
9
10
11
require_relative '../../../spec_helper'
require 'zlib'
require 'stringio'

describe "Zlib::GzipReader#mtime" do
  it "returns the timestamp from the Gzip header" do
    io = StringIO.new "\x1f\x8b\x08\x00\x44\x33\x22\x11\x00\xff\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00"
    gz = Zlib::GzipReader.new(io)
    gz.mtime.to_i.should == 0x11223344
  end
end