rc-rest 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ = 2.2.1
2
+
3
+ * Turn IOError into RCRest::CommunicationError for #post and #post_multipart.
4
+
1
5
  = 2.2.0
2
6
 
3
7
  * Moved to seattlerb rubyforge project
@@ -49,7 +49,7 @@ class RCRest
49
49
  ##
50
50
  # You are using this version of RCRest
51
51
 
52
- VERSION = '2.2.0'
52
+ VERSION = '2.2.1'
53
53
 
54
54
  ##
55
55
  # Abstract Error class.
@@ -233,7 +233,7 @@ class RCRest
233
233
  check_error xml
234
234
 
235
235
  parse_response xml
236
- rescue SystemCallError, SocketError, Timeout::Error,
236
+ rescue SystemCallError, SocketError, Timeout::Error, IOError,
237
237
  REXML::ParseException => e
238
238
  raise CommunicationError.new(e)
239
239
  rescue Net::HTTPError => e
@@ -266,7 +266,7 @@ class RCRest
266
266
  check_error xml
267
267
 
268
268
  parse_response xml
269
- rescue SystemCallError, SocketError, Timeout::Error,
269
+ rescue SystemCallError, SocketError, Timeout::Error, IOError,
270
270
  REXML::ParseException => e
271
271
  raise CommunicationError.new(e)
272
272
  rescue Net::HTTPError => e
@@ -146,6 +146,14 @@ unhandled error:
146
146
  assert_raise RCRest::CommunicationError do @fs.do_post end
147
147
  end
148
148
 
149
+ def test_do_post_eof_error
150
+ Net::HTTP.responses << proc do
151
+ raise IOError, 'end of file reached'
152
+ end
153
+
154
+ assert_raise RCRest::CommunicationError do @fs.do_post end
155
+ end
156
+
149
157
  def test_do_post_multipart
150
158
  xml = '<result>stuff</result>'
151
159
  Net::HTTP.responses << xml
@@ -170,6 +178,14 @@ value\r
170
178
  assert_equal '/method', Net::HTTP.paths.first
171
179
  end
172
180
 
181
+ def test_do_post_multipart_eof_error
182
+ Net::HTTP.responses << proc do
183
+ raise EOFError, 'end of file reached'
184
+ end
185
+
186
+ assert_raise RCRest::CommunicationError do @fs.do_post_multipart end
187
+ end
188
+
173
189
  def test_do_post_multipart_bad_xml
174
190
  xml = '<result>stuff</result><extra/>'
175
191
  Net::HTTP.responses << xml
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.1
3
3
  specification_version: 1
4
4
  name: rc-rest
5
5
  version: !ruby/object:Gem::Version
6
- version: 2.2.0
7
- date: 2007-01-29 00:00:00 -08:00
6
+ version: 2.2.1
7
+ date: 2007-01-31 00:00:00 -08:00
8
8
  summary: Robot Co-op REST web services base class
9
9
  require_paths:
10
10
  - lib