diff options
Diffstat (limited to 'spec/ruby/library/zlib/gzipreader/mtime_spec.rb')
-rw-r--r-- | spec/ruby/library/zlib/gzipreader/mtime_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/ruby/library/zlib/gzipreader/mtime_spec.rb b/spec/ruby/library/zlib/gzipreader/mtime_spec.rb new file mode 100644 index 0000000000..e8e71fa72e --- /dev/null +++ b/spec/ruby/library/zlib/gzipreader/mtime_spec.rb @@ -0,0 +1,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 |