summaryrefslogtreecommitdiff
path: root/spec/ruby/library/zlib/zstream/flush_next_out_spec.rb
blob: 8ba8414cd1e0ff1bcc512e4026e2ea9ac938d4c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require File.expand_path('../../../../spec_helper', __FILE__)
require 'zlib'

describe "Zlib::ZStream#flush_next_out" do

  it "flushes the stream and flushes the output buffer" do
    zs = Zlib::Inflate.new
    zs << [120, 156, 75, 203, 207, 7, 0, 2, 130, 1, 69].pack('C*')

    zs.flush_next_out.should == 'foo'
    zs.finished?.should == true
    zs.flush_next_out.should == ''
  end
end