bkocik-twitter 0.6.9 → 0.6.10

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.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 6
4
- :patch: 9
4
+ :patch: 10
@@ -70,7 +70,7 @@ module Twitter
70
70
  end
71
71
 
72
72
  def parse(response)
73
- JSON.parse(response.body)
73
+ JSON.parse(response.body) unless response.body.blank?
74
74
  end
75
75
 
76
76
  def mash(obj)
@@ -83,7 +83,7 @@ class RequestTest < Test::Unit::TestCase
83
83
 
84
84
  should "allow setting query string and headers" do
85
85
  response = mock('response') do
86
- stubs(:body).returns('{"a":"b"}')
86
+ stubs(:body).returns('')
87
87
  stubs(:code).returns('200')
88
88
  end
89
89
 
@@ -100,7 +100,7 @@ class RequestTest < Test::Unit::TestCase
100
100
 
101
101
  should "allow setting body and headers" do
102
102
  response = mock('response') do
103
- stubs(:body).returns('{"a":"b"}')
103
+ stubs(:body).returns('')
104
104
  stubs(:code).returns('200')
105
105
  end
106
106
 
@@ -138,14 +138,14 @@ class RequestTest < Test::Unit::TestCase
138
138
  end
139
139
 
140
140
  should "not raise error for 200" do
141
- stub_get('http://twitter.com:80/foo', 'generic_response.json', ['200'])
141
+ stub_get('http://twitter.com:80/foo', '', ['200'])
142
142
  lambda {
143
143
  Twitter::Request.get(@client, '/foo')
144
144
  }.should_not raise_error
145
145
  end
146
146
 
147
147
  should "not raise error for 304" do
148
- stub_get('http://twitter.com:80/foo', 'generic_response.json', ['304'])
148
+ stub_get('http://twitter.com:80/foo', '', ['304'])
149
149
  lambda {
150
150
  Twitter::Request.get(@client, '/foo')
151
151
  }.should_not raise_error
@@ -159,14 +159,14 @@ class RequestTest < Test::Unit::TestCase
159
159
  end
160
160
 
161
161
  should "raise Unauthorized for 401" do
162
- stub_get('http://twitter.com:80/foo', 'generic_response.json', ['401'])
162
+ stub_get('http://twitter.com:80/foo', '', ['401'])
163
163
  lambda {
164
164
  Twitter::Request.get(@client, '/foo')
165
165
  }.should raise_error(Twitter::Unauthorized)
166
166
  end
167
167
 
168
168
  should "raise General for 403" do
169
- stub_get('http://twitter.com:80/foo', 'generic_response.json', ['403'])
169
+ stub_get('http://twitter.com:80/foo', '', ['403'])
170
170
  lambda {
171
171
  Twitter::Request.get(@client, '/foo')
172
172
  }.should raise_error(Twitter::General)
@@ -214,4 +214,4 @@ class RequestTest < Test::Unit::TestCase
214
214
  object.class.should_not be(Mash)
215
215
  end
216
216
  end
217
- end
217
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bkocik-twitter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.9
4
+ version: 0.6.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-05-13 00:00:00 -07:00
13
+ date: 2009-05-14 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -139,7 +139,6 @@ files:
139
139
  - test/fixtures/follower_ids.json
140
140
  - test/fixtures/friend_ids.json
141
141
  - test/fixtures/friends_timeline.json
142
- - test/fixtures/generic_response.json
143
142
  - test/fixtures/rate_limit_exceeded.json
144
143
  - test/fixtures/replies.json
145
144
  - test/fixtures/search.json
@@ -1 +0,0 @@
1
- {"just_giving":"json_someething_to_parse"}