ruby-fs-stack 0.2.4 → 0.2.5
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 +1 -1
- data/lib/ruby-fs-stack/fs_communicator.rb +2 -0
- data/ruby-fs-stack.gemspec +1 -1
- data/spec/communicator_spec.rb +41 -0
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.5
|
data/ruby-fs-stack.gemspec
CHANGED
data/spec/communicator_spec.rb
CHANGED
@@ -229,6 +229,8 @@ describe FsCommunicator do
|
|
229
229
|
def fake_web(path,status,message)
|
230
230
|
FakeWeb.register_uri(:get, "https://api.familysearch.org#{path}?sessionId=SESSID&dataFormat=application/json", :body => "",
|
231
231
|
:status => [status, message])
|
232
|
+
FakeWeb.register_uri(:post, "https://api.familysearch.org#{path}?sessionId=SESSID&dataFormat=application/json", :body => "",
|
233
|
+
:status => [status, message])
|
232
234
|
end
|
233
235
|
|
234
236
|
before(:each) do
|
@@ -248,6 +250,9 @@ describe FsCommunicator do
|
|
248
250
|
lambda{
|
249
251
|
@com.get(@path)
|
250
252
|
}.should raise_error(RubyFsStack::UserActionRequired)
|
253
|
+
lambda{
|
254
|
+
@com.post(@path,"")
|
255
|
+
}.should raise_error(RubyFsStack::UserActionRequired)
|
251
256
|
end
|
252
257
|
|
253
258
|
it "should raise a BadRequest on a 400" do
|
@@ -255,6 +260,9 @@ describe FsCommunicator do
|
|
255
260
|
lambda{
|
256
261
|
@com.get(@path)
|
257
262
|
}.should raise_error(RubyFsStack::BadRequest)
|
263
|
+
lambda{
|
264
|
+
@com.post(@path,"")
|
265
|
+
}.should raise_error(RubyFsStack::BadRequest)
|
258
266
|
end
|
259
267
|
|
260
268
|
it "should raise a BadRequest on a 401" do
|
@@ -262,6 +270,9 @@ describe FsCommunicator do
|
|
262
270
|
lambda{
|
263
271
|
@com.get(@path)
|
264
272
|
}.should raise_error(RubyFsStack::Unauthorized)
|
273
|
+
lambda{
|
274
|
+
@com.post(@path,"")
|
275
|
+
}.should raise_error(RubyFsStack::Unauthorized)
|
265
276
|
end
|
266
277
|
|
267
278
|
it "should raise a Forbidden on 403" do
|
@@ -269,6 +280,9 @@ describe FsCommunicator do
|
|
269
280
|
lambda{
|
270
281
|
@com.get(@path)
|
271
282
|
}.should raise_error(RubyFsStack::Forbidden)
|
283
|
+
lambda{
|
284
|
+
@com.post(@path,"")
|
285
|
+
}.should raise_error(RubyFsStack::Forbidden)
|
272
286
|
end
|
273
287
|
|
274
288
|
it "should raise a 404 NotFound" do
|
@@ -276,6 +290,9 @@ describe FsCommunicator do
|
|
276
290
|
lambda{
|
277
291
|
@com.get(@path)
|
278
292
|
}.should raise_error(RubyFsStack::NotFound)
|
293
|
+
lambda{
|
294
|
+
@com.post(@path,"")
|
295
|
+
}.should raise_error(RubyFsStack::NotFound)
|
279
296
|
end
|
280
297
|
|
281
298
|
it "should raise a 409 Conflict" do
|
@@ -283,6 +300,9 @@ describe FsCommunicator do
|
|
283
300
|
lambda{
|
284
301
|
@com.get(@path)
|
285
302
|
}.should raise_error(RubyFsStack::Conflict)
|
303
|
+
lambda{
|
304
|
+
@com.post(@path,"")
|
305
|
+
}.should raise_error(RubyFsStack::Conflict)
|
286
306
|
end
|
287
307
|
|
288
308
|
it "should raise a 410 Gone" do
|
@@ -290,6 +310,9 @@ describe FsCommunicator do
|
|
290
310
|
lambda{
|
291
311
|
@com.get(@path)
|
292
312
|
}.should raise_error(RubyFsStack::Gone)
|
313
|
+
lambda{
|
314
|
+
@com.post(@path,"")
|
315
|
+
}.should raise_error(RubyFsStack::Gone)
|
293
316
|
end
|
294
317
|
|
295
318
|
it "should raise a 415 InvalidContentType" do
|
@@ -297,6 +320,9 @@ describe FsCommunicator do
|
|
297
320
|
lambda{
|
298
321
|
@com.get(@path)
|
299
322
|
}.should raise_error(RubyFsStack::InvalidContentType)
|
323
|
+
lambda{
|
324
|
+
@com.post(@path,"")
|
325
|
+
}.should raise_error(RubyFsStack::InvalidContentType)
|
300
326
|
end
|
301
327
|
|
302
328
|
it "should raise a 430 BadVersion" do
|
@@ -304,6 +330,9 @@ describe FsCommunicator do
|
|
304
330
|
lambda{
|
305
331
|
@com.get(@path)
|
306
332
|
}.should raise_error(RubyFsStack::BadVersion)
|
333
|
+
lambda{
|
334
|
+
@com.post(@path,"")
|
335
|
+
}.should raise_error(RubyFsStack::BadVersion)
|
307
336
|
end
|
308
337
|
|
309
338
|
it "should raise a 431 InvalidDeveloperKey" do
|
@@ -311,6 +340,9 @@ describe FsCommunicator do
|
|
311
340
|
lambda{
|
312
341
|
@com.get(@path)
|
313
342
|
}.should raise_error(RubyFsStack::InvalidDeveloperKey)
|
343
|
+
lambda{
|
344
|
+
@com.post(@path,"")
|
345
|
+
}.should raise_error(RubyFsStack::InvalidDeveloperKey)
|
314
346
|
end
|
315
347
|
|
316
348
|
it "should raise a 500 ServerError" do
|
@@ -318,6 +350,9 @@ describe FsCommunicator do
|
|
318
350
|
lambda{
|
319
351
|
@com.get(@path)
|
320
352
|
}.should raise_error(RubyFsStack::ServerError)
|
353
|
+
lambda{
|
354
|
+
@com.post(@path,"")
|
355
|
+
}.should raise_error(RubyFsStack::ServerError)
|
321
356
|
end
|
322
357
|
|
323
358
|
it "should raise a 501 NotImplemented" do
|
@@ -325,6 +360,9 @@ describe FsCommunicator do
|
|
325
360
|
lambda{
|
326
361
|
@com.get(@path)
|
327
362
|
}.should raise_error(RubyFsStack::NotImplemented)
|
363
|
+
lambda{
|
364
|
+
@com.post(@path,"")
|
365
|
+
}.should raise_error(RubyFsStack::NotImplemented)
|
328
366
|
end
|
329
367
|
|
330
368
|
it "should raise a 503 ServiceUnavailable" do
|
@@ -332,6 +370,9 @@ describe FsCommunicator do
|
|
332
370
|
lambda{
|
333
371
|
@com.get(@path)
|
334
372
|
}.should raise_error(RubyFsStack::ServiceUnavailable)
|
373
|
+
lambda{
|
374
|
+
@com.post(@path,"")
|
375
|
+
}.should raise_error(RubyFsStack::ServiceUnavailable)
|
335
376
|
end
|
336
377
|
end
|
337
378
|
|