httparty 0.13.2 → 0.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of httparty might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/History +4 -0
- data/lib/httparty/request.rb +1 -1
- data/lib/httparty/version.rb +1 -1
- data/spec/httparty/request_spec.rb +0 -1
- data/spec/httparty_spec.rb +10 -0
- data/spec/support/stub_response.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb42a1df375baa50335dbd9151a62dd8dff18ca6
|
4
|
+
data.tar.gz: 7bd368829511fe16e9ee7feee2d30c234ea5a04a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cb7342774ce3435cce9098959d3d23b51ffbf98d0a858af47da257e5bb1610411d8cc68ec43f56a1a93048ca29a0dec2cbd77735c2ae56b8be5a9b45559ce0b
|
7
|
+
data.tar.gz: e34c9b170df6166dcf763c16d17fcdfe41098b91c138c2ee1fbb51b9f38439e0d6fe6890987d214b77b3a76f313c847b87fb68d6fa923bef4a19650533d26da5
|
data/History
CHANGED
data/lib/httparty/request.rb
CHANGED
data/lib/httparty/version.rb
CHANGED
data/spec/httparty_spec.rb
CHANGED
@@ -699,6 +699,16 @@ describe HTTParty do
|
|
699
699
|
end.should == chunks.join
|
700
700
|
end
|
701
701
|
|
702
|
+
it "should return an empty body if stream_body option is turned on" do
|
703
|
+
chunks = ["Chunk1", "Chunk2", "Chunk3", "Chunk4"]
|
704
|
+
options = {stream_body: true, format: 'html'}
|
705
|
+
stub_chunked_http_response_with(chunks, options)
|
706
|
+
|
707
|
+
HTTParty.get('http://www.google.com', options) do |fragment|
|
708
|
+
chunks.should include(fragment)
|
709
|
+
end.should == nil
|
710
|
+
end
|
711
|
+
|
702
712
|
it "should be able parse response type json automatically" do
|
703
713
|
stub_http_response_with('twitter.json')
|
704
714
|
tweets = HTTParty.get('http://twitter.com/statuses/public_timeline.json')
|
@@ -13,14 +13,14 @@ module HTTParty
|
|
13
13
|
HTTParty::Request.should_receive(:new).and_return(http_request)
|
14
14
|
end
|
15
15
|
|
16
|
-
def stub_chunked_http_response_with(chunks)
|
16
|
+
def stub_chunked_http_response_with(chunks, options={format: "html"})
|
17
17
|
response = Net::HTTPResponse.new("1.1", 200, nil)
|
18
18
|
response.stub(:chunked_data).and_return(chunks)
|
19
19
|
def response.read_body(&block)
|
20
20
|
@body || chunked_data.each(&block)
|
21
21
|
end
|
22
22
|
|
23
|
-
http_request = HTTParty::Request.new(Net::HTTP::Get, 'http://localhost',
|
23
|
+
http_request = HTTParty::Request.new(Net::HTTP::Get, 'http://localhost', options)
|
24
24
|
http_request.stub_chain(:http, :request).and_yield(response).and_return(response)
|
25
25
|
|
26
26
|
HTTParty::Request.should_receive(:new).and_return(http_request)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httparty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-11-
|
12
|
+
date: 2014-11-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|