summaryrefslogtreecommitdiff
path: root/spec/unit/rest_spec.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-03-20 17:04:02 -0700
committersersut <serdar@opscode.com>2014-03-27 15:37:26 -0700
commit77b5d44143f94ad604de7d6013dd9be4f503a6e5 (patch)
treeea3c5742dbe461add803356784ab19d4f22545b7 /spec/unit/rest_spec.rb
parent12e0d2468f09ed107d240cd49b7b3f2b0e3d5dbe (diff)
downloadchef-77b5d44143f94ad604de7d6013dd9be4f503a6e5.tar.gz
CHEF-5100:
- Enable Content Validation Check for Chef::HTTP::Simple - Tidy up debug logs / comments - More specs.
Diffstat (limited to 'spec/unit/rest_spec.rb')
-rw-r--r--spec/unit/rest_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/unit/rest_spec.rb b/spec/unit/rest_spec.rb
index 8c83b34c9f..a8eb1ac7db 100644
--- a/spec/unit/rest_spec.rb
+++ b/spec/unit/rest_spec.rb
@@ -76,6 +76,16 @@ describe Chef::REST do
Chef::Log.init(log_stringio)
end
+ it "should have content length validation middleware after compressor middleware" do
+ middlewares = rest.instance_variable_get(:@middlewares)
+ content_length = middlewares.find_index { |e| e.is_a? Chef::HTTP::ValidateContentLength }
+ decompressor = middlewares.find_index { |e| e.is_a? Chef::HTTP::Decompressor }
+
+ content_length.should_not be_nil
+ decompressor.should_not be_nil
+ (decompressor < content_length).should be_true
+ end
+
it "should allow the options hash to be frozen" do
options = {}.freeze
# should not raise any exception