diff options
| author | Daniel Pittman <daniel@rimspace.net> | 2011-02-22 14:18:57 -0800 |
|---|---|---|
| committer | Daniel Pittman <daniel@rimspace.net> | 2011-03-03 15:43:20 -0800 |
| commit | b311651526c7c9448bdd9a77a111302fd0c0efa4 (patch) | |
| tree | b63430a7ec9b540dfb9658e761f59243ffddeedf /spec/unit/network | |
| parent | af2c85b5a98ba062a9a58c6c92279f3371d59bb4 (diff) | |
| download | puppet-b311651526c7c9448bdd9a77a111302fd0c0efa4.tar.gz puppet-b311651526c7c9448bdd9a77a111302fd0c0efa4.tar.xz puppet-b311651526c7c9448bdd9a77a111302fd0c0efa4.zip | |
(#6407) Fix spec test hang with Mocha >= 0.9.11 in zlib testing
We had a combination of bad logic, and bad testing, and a nasty behaviour of
Mocha <= 0.9.10 that would result in a false pass for one of our tests.
This not only falsely passed, but hid an infinite loop retrying decompression
on an invalid data stream; it could be triggered by anything that sent an HTTP
request with an invalid compressed body, resulting in a livelock.
Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
Diffstat (limited to 'spec/unit/network')
| -rwxr-xr-x[-rw-r--r--] | spec/unit/network/http/compression_spec.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/unit/network/http/compression_spec.rb b/spec/unit/network/http/compression_spec.rb index d44c5f1bb..85c62f358 100644..100755 --- a/spec/unit/network/http/compression_spec.rb +++ b/spec/unit/network/http/compression_spec.rb @@ -178,7 +178,7 @@ describe "http compression" do end it "should raise the error the second time" do - @inflater.expects(:inflate).raises(Zlib::DataError.new("not a zlib stream")) + @inflater.stubs(:inflate).raises(Zlib::DataError.new("not a zlib stream")) Zlib::Inflate.expects(:new).with.returns(@inflater) lambda { @adapter.uncompress("chunk") }.should raise_error end |
