spec/http/http_put_spec.rb in yajl-ruby-0.6.3 vs spec/http/http_put_spec.rb in yajl-ruby-0.6.4
- old
+ new
@@ -1,8 +1,12 @@
# encoding: UTF-8
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
-require 'yajl/bzip2'
+begin
+ require 'yajl/bzip2'
+rescue
+ warn "Couldn't load yajl/bzip2, maybe you don't have bzip2-ruby installed? Continuing without running bzip2 specs."
+end
require 'yajl/gzip'
require 'yajl/deflate'
require 'yajl/http_stream'
def parse_off_headers(io)
@@ -52,17 +56,19 @@
it "should parse a raw response and symbolize keys" do
prepare_mock_request_dump :raw
@template_hash_symbolized.should == Yajl::HttpStream.put(@uri, @body, :symbolize_keys => true)
end
- it "should parse a bzip2 compressed response" do
- prepare_mock_request_dump :bzip2
- @template_hash.should == Yajl::HttpStream.put(@uri, @body)
- end
+ if defined?(Yajl::Bzip2::StreamReader)
+ it "should parse a bzip2 compressed response" do
+ prepare_mock_request_dump :bzip2
+ @template_hash.should == Yajl::HttpStream.put(@uri, @body)
+ end
- it "should parse a bzip2 compressed response and symbolize keys" do
- prepare_mock_request_dump :bzip2
- @template_hash_symbolized.should == Yajl::HttpStream.put(@uri, @body, :symbolize_keys => true)
+ it "should parse a bzip2 compressed response and symbolize keys" do
+ prepare_mock_request_dump :bzip2
+ @template_hash_symbolized.should == Yajl::HttpStream.put(@uri, @body, :symbolize_keys => true)
+ end
end
it "should parse a deflate compressed response" do
prepare_mock_request_dump :deflate
@template_hash.should == Yajl::HttpStream.put(@uri, @body)
\ No newline at end of file