summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/rest_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/unit/rest_spec.rb b/spec/unit/rest_spec.rb
index bd38b1596f..4609caf5dc 100644
--- a/spec/unit/rest_spec.rb
+++ b/spec/unit/rest_spec.rb
@@ -387,7 +387,7 @@ describe Chef::REST do
http_response.add_field("content-encoding", "deflate")
unzipped_body = '{ "error":[ "Ears get sore!", "Not even four" ] }'
gzipped_body = Zlib::Deflate.deflate(unzipped_body)
- gzipped_body.force_encoding(Encoding::BINARY)
+ gzipped_body.force_encoding(Encoding::BINARY) if "strings".respond_to?(:force_encoding)
http_response.stub!(:body).and_return gzipped_body
http_response.stub!(:read_body)