sucker 1.0.0.beta.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. data/CHANGELOG.md +12 -2
  2. data/README.md +5 -2
  3. data/lib/sucker.rbc +341 -0
  4. data/lib/sucker/request.rb +1 -1
  5. data/lib/sucker/request.rbc +2481 -0
  6. data/lib/sucker/response.rb +19 -7
  7. data/lib/sucker/response.rbc +1554 -0
  8. data/lib/sucker/version.rb +2 -2
  9. data/lib/sucker/version.rbc +130 -0
  10. data/spec/fixtures/asins.txt +9406 -406
  11. data/spec/fixtures/cassette_library/integration/alternate_versions.yml +27 -0
  12. data/spec/fixtures/cassette_library/integration/errors.yml +27 -0
  13. data/spec/fixtures/cassette_library/integration/france.yml +27 -0
  14. data/spec/fixtures/cassette_library/integration/images.yml +27 -0
  15. data/spec/fixtures/cassette_library/integration/item_lookup/multiple.yml +27 -0
  16. data/spec/fixtures/cassette_library/integration/item_lookup/single.yml +27 -0
  17. data/spec/fixtures/cassette_library/integration/item_search.yml +27 -0
  18. data/spec/fixtures/cassette_library/integration/japan.yml +27 -0
  19. data/spec/fixtures/cassette_library/integration/keyword_search.yml +27 -0
  20. data/spec/fixtures/cassette_library/integration/kindle.yml +27 -0
  21. data/spec/fixtures/cassette_library/integration/kindle_2.yml +27 -0
  22. data/spec/fixtures/cassette_library/integration/multiple_locales.yml +157 -0
  23. data/spec/fixtures/cassette_library/integration/power_search.yml +27 -0
  24. data/spec/fixtures/cassette_library/integration/related_items/child.yml +27 -0
  25. data/spec/fixtures/cassette_library/integration/related_items/parent.yml +27 -0
  26. data/spec/fixtures/cassette_library/integration/seller_listings_search.yml +27 -0
  27. data/spec/fixtures/cassette_library/integration/twenty_items.yml +27 -0
  28. data/spec/fixtures/cassette_library/unit/sucker/request.yml +29 -0
  29. data/spec/fixtures/cassette_library/unit/sucker/response.yml +27 -0
  30. data/spec/integration/alternate_versions_spec.rb +28 -20
  31. data/spec/integration/alternate_versions_spec.rbc +843 -0
  32. data/spec/integration/errors_spec.rb +10 -6
  33. data/spec/integration/errors_spec.rbc +964 -0
  34. data/spec/integration/france_spec.rb +33 -25
  35. data/spec/integration/france_spec.rbc +1012 -0
  36. data/spec/integration/images_spec.rb +32 -24
  37. data/spec/integration/images_spec.rbc +1047 -0
  38. data/spec/integration/item_lookup_spec.rb +11 -3
  39. data/spec/integration/item_lookup_spec.rbc +1723 -0
  40. data/spec/integration/item_search_spec.rb +6 -2
  41. data/spec/integration/item_search_spec.rbc +926 -0
  42. data/spec/integration/japan_spec.rb +27 -19
  43. data/spec/integration/japan_spec.rbc +849 -0
  44. data/spec/integration/keyword_search_spec.rb +5 -0
  45. data/spec/integration/keyword_search_spec.rbc +838 -0
  46. data/spec/integration/kindle_spec.rb +13 -5
  47. data/spec/integration/kindle_spec.rbc +1425 -0
  48. data/spec/integration/multiple_locales_spec.rb +34 -26
  49. data/spec/integration/multiple_locales_spec.rbc +1090 -0
  50. data/spec/integration/power_search_spec.rb +5 -0
  51. data/spec/integration/power_search_spec.rbc +838 -0
  52. data/spec/integration/related_items_spec.rb +41 -29
  53. data/spec/integration/related_items_spec.rbc +1228 -0
  54. data/spec/integration/seller_listing_search_spec.rb +3 -0
  55. data/spec/integration/seller_listing_search_spec.rbc +852 -0
  56. data/spec/integration/twenty_items_spec.rb +41 -34
  57. data/spec/integration/twenty_items_spec.rbc +1166 -0
  58. data/spec/spec_helper.rbc +231 -0
  59. data/spec/support/amazon.yml +3 -0
  60. data/spec/support/amazon.yml.example +1 -0
  61. data/spec/support/amazon_credentials.rbc +154 -0
  62. data/spec/support/asins.rb +6 -1
  63. data/spec/support/asins.rbc +335 -0
  64. data/spec/support/vcr.rbc +360 -0
  65. data/spec/unit/sucker/request_spec.rb +57 -23
  66. data/spec/unit/sucker/request_spec.rbc +4031 -0
  67. data/spec/unit/sucker/response_spec.rb +100 -26
  68. data/spec/unit/sucker/response_spec.rbc +3787 -0
  69. data/spec/unit/sucker_spec.rb +5 -1
  70. data/spec/unit/sucker_spec.rbc +299 -0
  71. metadata +94 -12
@@ -3,7 +3,9 @@
3
3
  require "spec_helper"
4
4
 
5
5
  module Sucker
6
+
6
7
  describe "Item Search" do
8
+
7
9
  use_vcr_cassette "integration/item_search", :record => :new_episodes
8
10
 
9
11
  let(:worker) do
@@ -19,11 +21,11 @@ module Sucker
19
21
  worker
20
22
  end
21
23
 
22
- it "works for Orwell" do
24
+ it "works for a single-word phrases" do
23
25
  worker.get.should be_valid
24
26
  end
25
27
 
26
- it "works for George Orwell, too" do
28
+ it "works for multiple-word phrases" do
27
29
  worker << {
28
30
  "Operation" => "ItemSearch",
29
31
  "SearchIndex" => "Books",
@@ -33,5 +35,7 @@ module Sucker
33
35
  response.should be_valid
34
36
  response.find("TotalPages").first.should be_an_instance_of String
35
37
  end
38
+
36
39
  end
40
+
37
41
  end
@@ -0,0 +1,926 @@
1
+ !RBIX
2
+ 0
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 37
13
+ 5
14
+ 7
15
+ 0
16
+ 64
17
+ 47
18
+ 49
19
+ 1
20
+ 1
21
+ 15
22
+ 99
23
+ 7
24
+ 2
25
+ 65
26
+ 49
27
+ 3
28
+ 2
29
+ 13
30
+ 99
31
+ 12
32
+ 7
33
+ 4
34
+ 12
35
+ 7
36
+ 5
37
+ 12
38
+ 65
39
+ 12
40
+ 49
41
+ 6
42
+ 4
43
+ 15
44
+ 49
45
+ 4
46
+ 0
47
+ 15
48
+ 2
49
+ 11
50
+ I
51
+ 6
52
+ I
53
+ 0
54
+ I
55
+ 0
56
+ I
57
+ 0
58
+ n
59
+ p
60
+ 7
61
+ s
62
+ 11
63
+ spec_helper
64
+ x
65
+ 7
66
+ require
67
+ x
68
+ 6
69
+ Sucker
70
+ x
71
+ 11
72
+ open_module
73
+ x
74
+ 15
75
+ __module_init__
76
+ M
77
+ 1
78
+ n
79
+ n
80
+ x
81
+ 6
82
+ Sucker
83
+ i
84
+ 13
85
+ 5
86
+ 66
87
+ 5
88
+ 7
89
+ 0
90
+ 64
91
+ 56
92
+ 1
93
+ 47
94
+ 50
95
+ 2
96
+ 1
97
+ 11
98
+ I
99
+ 3
100
+ I
101
+ 0
102
+ I
103
+ 0
104
+ I
105
+ 0
106
+ n
107
+ p
108
+ 3
109
+ s
110
+ 11
111
+ Item Search
112
+ M
113
+ 1
114
+ p
115
+ 2
116
+ x
117
+ 9
118
+ for_block
119
+ t
120
+ n
121
+ x
122
+ 6
123
+ Sucker
124
+ i
125
+ 57
126
+ 5
127
+ 7
128
+ 0
129
+ 64
130
+ 44
131
+ 43
132
+ 1
133
+ 79
134
+ 49
135
+ 2
136
+ 1
137
+ 13
138
+ 7
139
+ 3
140
+ 7
141
+ 4
142
+ 49
143
+ 5
144
+ 2
145
+ 15
146
+ 47
147
+ 49
148
+ 6
149
+ 2
150
+ 15
151
+ 5
152
+ 7
153
+ 7
154
+ 56
155
+ 8
156
+ 47
157
+ 50
158
+ 9
159
+ 1
160
+ 15
161
+ 5
162
+ 7
163
+ 10
164
+ 64
165
+ 56
166
+ 11
167
+ 47
168
+ 50
169
+ 12
170
+ 1
171
+ 15
172
+ 5
173
+ 7
174
+ 13
175
+ 64
176
+ 56
177
+ 14
178
+ 47
179
+ 50
180
+ 12
181
+ 1
182
+ 11
183
+ I
184
+ 7
185
+ I
186
+ 0
187
+ I
188
+ 0
189
+ I
190
+ 0
191
+ I
192
+ -2
193
+ p
194
+ 15
195
+ s
196
+ 23
197
+ integration/item_search
198
+ x
199
+ 4
200
+ Hash
201
+ x
202
+ 16
203
+ new_from_literal
204
+ x
205
+ 6
206
+ record
207
+ x
208
+ 12
209
+ new_episodes
210
+ x
211
+ 3
212
+ []=
213
+ x
214
+ 16
215
+ use_vcr_cassette
216
+ x
217
+ 6
218
+ worker
219
+ M
220
+ 1
221
+ p
222
+ 2
223
+ x
224
+ 9
225
+ for_block
226
+ t
227
+ n
228
+ x
229
+ 6
230
+ Sucker
231
+ i
232
+ 177
233
+ 45
234
+ 0
235
+ 1
236
+ 13
237
+ 71
238
+ 2
239
+ 47
240
+ 9
241
+ 71
242
+ 47
243
+ 49
244
+ 3
245
+ 0
246
+ 13
247
+ 44
248
+ 43
249
+ 4
250
+ 4
251
+ 3
252
+ 49
253
+ 5
254
+ 1
255
+ 13
256
+ 7
257
+ 6
258
+ 7
259
+ 7
260
+ 64
261
+ 49
262
+ 8
263
+ 2
264
+ 15
265
+ 13
266
+ 7
267
+ 9
268
+ 5
269
+ 48
270
+ 10
271
+ 7
272
+ 11
273
+ 64
274
+ 49
275
+ 12
276
+ 1
277
+ 49
278
+ 8
279
+ 2
280
+ 15
281
+ 13
282
+ 7
283
+ 13
284
+ 5
285
+ 48
286
+ 10
287
+ 7
288
+ 14
289
+ 64
290
+ 49
291
+ 12
292
+ 1
293
+ 49
294
+ 8
295
+ 2
296
+ 15
297
+ 47
298
+ 49
299
+ 15
300
+ 1
301
+ 15
302
+ 8
303
+ 124
304
+ 44
305
+ 43
306
+ 4
307
+ 4
308
+ 3
309
+ 49
310
+ 5
311
+ 1
312
+ 13
313
+ 7
314
+ 6
315
+ 7
316
+ 7
317
+ 64
318
+ 49
319
+ 8
320
+ 2
321
+ 15
322
+ 13
323
+ 7
324
+ 9
325
+ 5
326
+ 48
327
+ 10
328
+ 7
329
+ 11
330
+ 64
331
+ 49
332
+ 12
333
+ 1
334
+ 49
335
+ 8
336
+ 2
337
+ 15
338
+ 13
339
+ 7
340
+ 13
341
+ 5
342
+ 48
343
+ 10
344
+ 7
345
+ 14
346
+ 64
347
+ 49
348
+ 12
349
+ 1
350
+ 49
351
+ 8
352
+ 2
353
+ 15
354
+ 49
355
+ 2
356
+ 1
357
+ 19
358
+ 0
359
+ 15
360
+ 20
361
+ 0
362
+ 44
363
+ 43
364
+ 4
365
+ 4
366
+ 3
367
+ 49
368
+ 5
369
+ 1
370
+ 13
371
+ 7
372
+ 16
373
+ 64
374
+ 7
375
+ 17
376
+ 64
377
+ 49
378
+ 8
379
+ 2
380
+ 15
381
+ 13
382
+ 7
383
+ 18
384
+ 64
385
+ 7
386
+ 19
387
+ 64
388
+ 49
389
+ 8
390
+ 2
391
+ 15
392
+ 13
393
+ 7
394
+ 20
395
+ 64
396
+ 7
397
+ 21
398
+ 64
399
+ 49
400
+ 8
401
+ 2
402
+ 15
403
+ 49
404
+ 22
405
+ 1
406
+ 15
407
+ 20
408
+ 0
409
+ 11
410
+ I
411
+ 9
412
+ I
413
+ 1
414
+ I
415
+ 0
416
+ I
417
+ 0
418
+ I
419
+ -2
420
+ p
421
+ 23
422
+ x
423
+ 6
424
+ Sucker
425
+ n
426
+ x
427
+ 3
428
+ new
429
+ x
430
+ 8
431
+ allocate
432
+ x
433
+ 4
434
+ Hash
435
+ x
436
+ 16
437
+ new_from_literal
438
+ x
439
+ 6
440
+ locale
441
+ s
442
+ 2
443
+ us
444
+ x
445
+ 3
446
+ []=
447
+ x
448
+ 3
449
+ key
450
+ x
451
+ 6
452
+ amazon
453
+ s
454
+ 3
455
+ key
456
+ x
457
+ 2
458
+ []
459
+ x
460
+ 6
461
+ secret
462
+ s
463
+ 6
464
+ secret
465
+ x
466
+ 10
467
+ initialize
468
+ s
469
+ 9
470
+ Operation
471
+ s
472
+ 10
473
+ ItemSearch
474
+ s
475
+ 11
476
+ SearchIndex
477
+ s
478
+ 5
479
+ Books
480
+ s
481
+ 6
482
+ Author
483
+ s
484
+ 6
485
+ Orwell
486
+ x
487
+ 2
488
+ <<
489
+ p
490
+ 31
491
+ I
492
+ 0
493
+ I
494
+ b
495
+ I
496
+ 0
497
+ I
498
+ c
499
+ I
500
+ e
501
+ I
502
+ f
503
+ I
504
+ 17
505
+ I
506
+ d
507
+ I
508
+ 21
509
+ I
510
+ e
511
+ I
512
+ 31
513
+ I
514
+ f
515
+ I
516
+ 50
517
+ I
518
+ d
519
+ I
520
+ 5a
521
+ I
522
+ e
523
+ I
524
+ 6a
525
+ I
526
+ f
527
+ I
528
+ 7f
529
+ I
530
+ 11
531
+ I
532
+ 81
533
+ I
534
+ 14
535
+ I
536
+ 8a
537
+ I
538
+ 12
539
+ I
540
+ 95
541
+ I
542
+ 13
543
+ I
544
+ a0
545
+ I
546
+ 14
547
+ I
548
+ ae
549
+ I
550
+ 15
551
+ I
552
+ b1
553
+ x
554
+ 59
555
+ /Users/snl/code/sucker/spec/integration/item_search_spec.rb
556
+ p
557
+ 1
558
+ x
559
+ 6
560
+ worker
561
+ x
562
+ 3
563
+ let
564
+ s
565
+ 31
566
+ works for a single-word phrases
567
+ M
568
+ 1
569
+ p
570
+ 2
571
+ x
572
+ 9
573
+ for_block
574
+ t
575
+ n
576
+ x
577
+ 6
578
+ Sucker
579
+ i
580
+ 13
581
+ 5
582
+ 48
583
+ 0
584
+ 49
585
+ 1
586
+ 0
587
+ 5
588
+ 48
589
+ 2
590
+ 49
591
+ 3
592
+ 1
593
+ 11
594
+ I
595
+ 3
596
+ I
597
+ 0
598
+ I
599
+ 0
600
+ I
601
+ 0
602
+ I
603
+ -2
604
+ p
605
+ 4
606
+ x
607
+ 6
608
+ worker
609
+ x
610
+ 3
611
+ get
612
+ x
613
+ 8
614
+ be_valid
615
+ x
616
+ 6
617
+ should
618
+ p
619
+ 5
620
+ I
621
+ 0
622
+ I
623
+ 18
624
+ I
625
+ 0
626
+ I
627
+ 19
628
+ I
629
+ d
630
+ x
631
+ 59
632
+ /Users/snl/code/sucker/spec/integration/item_search_spec.rb
633
+ p
634
+ 0
635
+ x
636
+ 2
637
+ it
638
+ s
639
+ 31
640
+ works for multiple-word phrases
641
+ M
642
+ 1
643
+ p
644
+ 2
645
+ x
646
+ 9
647
+ for_block
648
+ t
649
+ n
650
+ x
651
+ 6
652
+ Sucker
653
+ i
654
+ 89
655
+ 5
656
+ 48
657
+ 0
658
+ 44
659
+ 43
660
+ 1
661
+ 4
662
+ 3
663
+ 49
664
+ 2
665
+ 1
666
+ 13
667
+ 7
668
+ 3
669
+ 64
670
+ 7
671
+ 4
672
+ 64
673
+ 49
674
+ 5
675
+ 2
676
+ 15
677
+ 13
678
+ 7
679
+ 6
680
+ 64
681
+ 7
682
+ 7
683
+ 64
684
+ 49
685
+ 5
686
+ 2
687
+ 15
688
+ 13
689
+ 7
690
+ 8
691
+ 64
692
+ 7
693
+ 9
694
+ 64
695
+ 49
696
+ 5
697
+ 2
698
+ 15
699
+ 49
700
+ 10
701
+ 1
702
+ 15
703
+ 5
704
+ 48
705
+ 0
706
+ 49
707
+ 11
708
+ 0
709
+ 19
710
+ 0
711
+ 15
712
+ 20
713
+ 0
714
+ 5
715
+ 48
716
+ 12
717
+ 49
718
+ 13
719
+ 1
720
+ 15
721
+ 20
722
+ 0
723
+ 7
724
+ 14
725
+ 64
726
+ 49
727
+ 15
728
+ 1
729
+ 49
730
+ 16
731
+ 0
732
+ 5
733
+ 45
734
+ 17
735
+ 18
736
+ 47
737
+ 49
738
+ 19
739
+ 1
740
+ 49
741
+ 13
742
+ 1
743
+ 11
744
+ I
745
+ 7
746
+ I
747
+ 1
748
+ I
749
+ 0
750
+ I
751
+ 0
752
+ I
753
+ -2
754
+ p
755
+ 20
756
+ x
757
+ 6
758
+ worker
759
+ x
760
+ 4
761
+ Hash
762
+ x
763
+ 16
764
+ new_from_literal
765
+ s
766
+ 9
767
+ Operation
768
+ s
769
+ 10
770
+ ItemSearch
771
+ x
772
+ 3
773
+ []=
774
+ s
775
+ 11
776
+ SearchIndex
777
+ s
778
+ 5
779
+ Books
780
+ s
781
+ 6
782
+ Author
783
+ s
784
+ 13
785
+ George Orwell
786
+ x
787
+ 2
788
+ <<
789
+ x
790
+ 3
791
+ get
792
+ x
793
+ 8
794
+ be_valid
795
+ x
796
+ 6
797
+ should
798
+ s
799
+ 10
800
+ TotalPages
801
+ x
802
+ 4
803
+ find
804
+ x
805
+ 5
806
+ first
807
+ x
808
+ 6
809
+ String
810
+ n
811
+ x
812
+ 17
813
+ be_an_instance_of
814
+ p
815
+ 19
816
+ I
817
+ 0
818
+ I
819
+ 1c
820
+ I
821
+ 0
822
+ I
823
+ 1d
824
+ I
825
+ 3
826
+ I
827
+ 20
828
+ I
829
+ c
830
+ I
831
+ 1e
832
+ I
833
+ 17
834
+ I
835
+ 1f
836
+ I
837
+ 22
838
+ I
839
+ 20
840
+ I
841
+ 30
842
+ I
843
+ 22
844
+ I
845
+ 39
846
+ I
847
+ 23
848
+ I
849
+ 42
850
+ I
851
+ 24
852
+ I
853
+ 59
854
+ x
855
+ 59
856
+ /Users/snl/code/sucker/spec/integration/item_search_spec.rb
857
+ p
858
+ 1
859
+ x
860
+ 8
861
+ response
862
+ p
863
+ 11
864
+ I
865
+ 0
866
+ I
867
+ 7
868
+ I
869
+ 0
870
+ I
871
+ 9
872
+ I
873
+ 19
874
+ I
875
+ b
876
+ I
877
+ 23
878
+ I
879
+ 18
880
+ I
881
+ 2e
882
+ I
883
+ 1c
884
+ I
885
+ 39
886
+ x
887
+ 59
888
+ /Users/snl/code/sucker/spec/integration/item_search_spec.rb
889
+ p
890
+ 0
891
+ x
892
+ 8
893
+ describe
894
+ p
895
+ 3
896
+ I
897
+ 2
898
+ I
899
+ 7
900
+ I
901
+ d
902
+ x
903
+ 59
904
+ /Users/snl/code/sucker/spec/integration/item_search_spec.rb
905
+ p
906
+ 0
907
+ x
908
+ 13
909
+ attach_method
910
+ p
911
+ 5
912
+ I
913
+ 0
914
+ I
915
+ 3
916
+ I
917
+ 9
918
+ I
919
+ 5
920
+ I
921
+ 25
922
+ x
923
+ 59
924
+ /Users/snl/code/sucker/spec/integration/item_search_spec.rb
925
+ p
926
+ 0