!RBIX 6235178746665710376 x M 1 n n x 10 __script__ i 37 5 7 0 64 47 49 1 1 15 99 7 2 65 49 3 2 13 99 12 7 4 12 7 5 12 65 12 49 6 4 15 49 4 0 15 2 11 I 6 I 0 I 0 I 0 n p 7 s 11 spec_helper x 7 require x 13 AmazonProduct x 11 open_module x 15 __module_init__ M 1 n n x 13 AmazonProduct i 13 5 66 5 45 0 1 56 2 47 50 3 1 11 I 3 I 0 I 0 I 0 n p 4 x 8 Response n M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 98 5 7 0 56 1 47 50 2 1 15 5 7 3 64 56 4 47 50 5 1 15 5 7 6 64 56 7 47 50 5 1 15 5 7 8 64 56 9 47 50 5 1 15 5 7 10 64 56 11 47 50 5 1 15 5 7 12 64 56 13 47 50 5 1 15 5 7 14 64 56 15 47 50 5 1 15 5 7 16 64 56 17 47 50 5 1 15 5 7 18 64 56 19 47 50 5 1 11 I 4 I 0 I 0 I 0 I -2 p 20 x 8 response M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 61 45 0 1 45 0 2 7 3 64 65 49 4 0 49 5 2 49 6 1 19 0 15 7 7 64 19 1 15 45 8 9 13 71 10 47 9 53 47 49 11 0 13 20 0 20 1 47 49 12 2 15 8 60 20 0 20 1 49 10 2 11 I 7 I 2 I 0 I 0 I -2 p 13 x 4 File n n s 28 ../../fixtures/http_response x 11 active_path x 11 expand_path x 4 read s 3 200 x 8 Response n x 3 new x 8 allocate x 10 initialize p 7 I 0 I 6 I 16 I 7 I 1c I 8 I 3d x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 2 x 4 body x 4 code x 3 let s 5 #each M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 11 5 7 0 64 56 1 47 50 2 1 11 I 4 I 0 I 0 I 0 I -2 p 3 s 21 when a block is given M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 11 5 7 0 64 56 1 47 50 2 1 11 I 4 I 0 I 0 I 0 I -2 p 3 s 25 yields matches to a block M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 25 3 19 0 15 5 48 0 7 1 64 56 2 50 3 1 15 20 0 5 48 4 49 5 1 11 I 5 I 1 I 0 I 0 I -2 p 6 x 8 response s 4 Item M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 9 57 19 0 15 2 22 1 0 11 I 3 I 1 I 1 I 1 n p 0 p 5 I 0 I f I 4 I 10 I 9 x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 1 x 4 item x 4 each x 7 be_true x 6 should p 7 I 0 I e I 4 I f I 10 I 13 I 19 x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 1 x 7 yielded x 2 it p 3 I 0 I d I b x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 x 7 context p 3 I 0 I c I b x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 x 8 describe s 7 #errors M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 11 5 7 0 64 56 1 47 50 2 1 11 I 4 I 0 I 0 I 0 I -2 p 3 s 26 returns an array of errors M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 59 5 48 0 7 1 64 7 2 13 70 9 24 15 44 43 3 7 4 78 49 5 2 6 2 7 6 64 49 7 2 49 8 0 13 18 2 49 9 1 15 15 5 48 0 49 10 0 49 11 0 7 12 64 35 1 49 13 1 11 I 6 I 0 I 0 I 0 I -2 p 14 x 8 response s 167 foo n x 6 Regexp s 5 >\s+< x 3 new s 2 >< x 5 gsub! x 6 strip! x 5 body= x 6 errors x 6 should s 3 foo x 2 =~ p 5 I 0 I 1a I 29 I 22 I 3b x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 x 2 it p 3 I 0 I 19 I b x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 s 12 #has_errors? M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 22 5 7 0 64 56 1 47 50 2 1 15 5 7 3 64 56 4 47 50 2 1 11 I 4 I 0 I 0 I 0 I -2 p 5 s 43 when a response does not contain any errors M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 11 5 7 0 64 56 1 47 50 2 1 11 I 4 I 0 I 0 I 0 I -2 p 3 s 13 returns false M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 24 5 48 0 7 1 49 2 1 35 0 49 3 1 15 5 48 0 5 48 4 49 5 1 11 I 3 I 0 I 0 I 0 I -2 p 6 x 8 response x 6 errors x 5 stub! x 10 and_return x 11 have_errors x 10 should_not p 5 I 0 I 29 I e I 2a I 18 x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 x 2 it p 3 I 0 I 28 I b x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 x 7 context s 31 when a response contains errors M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 11 5 7 0 64 56 1 47 50 2 1 11 I 4 I 0 I 0 I 0 I -2 p 3 s 12 returns true M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 25 5 48 0 7 1 49 2 1 79 35 1 49 3 1 15 5 48 0 5 48 4 49 5 1 11 I 3 I 0 I 0 I 0 I -2 p 6 x 8 response x 6 errors x 5 stub! x 10 and_return x 11 have_errors x 6 should p 5 I 0 I 30 I f I 31 I 19 x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 x 2 it p 3 I 0 I 2f I b x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 p 5 I 0 I 27 I b I 2e I 16 x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 s 5 #find M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 11 5 7 0 64 56 1 47 50 2 1 11 I 4 I 0 I 0 I 0 I -2 p 3 s 34 returns an array of matching nodes M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 16 5 48 0 7 1 64 49 2 1 5 48 3 49 4 1 11 I 3 I 0 I 0 I 0 I -2 p 5 x 8 response s 4 ASIN x 4 find x 8 be_empty x 10 should_not p 3 I 0 I 38 I 10 x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 x 2 it p 3 I 0 I 37 I b x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 s 4 #map M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 11 5 7 0 64 56 1 47 50 2 1 11 I 4 I 0 I 0 I 0 I -2 p 3 s 53 yields each match to a block and maps returned values M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 29 5 48 0 7 1 64 56 2 50 3 1 19 0 15 20 0 49 4 0 5 80 47 49 5 1 49 6 1 11 I 5 I 1 I 0 I 0 I -2 p 7 x 8 response s 4 Item M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 19 57 19 0 15 20 0 7 0 64 49 1 1 7 2 64 49 1 1 11 I 4 I 1 I 1 I 1 n p 3 s 14 ItemAttributes x 2 [] s 5 Title p 3 I 0 I 3e I 13 x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 1 x 4 item x 3 map x 5 count x 3 eql x 6 should p 5 I 0 I 3e I e I 3f I 1d x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 1 x 6 titles x 2 it p 3 I 0 I 3d I b x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 s 8 #to_hash M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 11 5 7 0 64 56 1 47 50 2 1 11 I 4 I 0 I 0 I 0 I -2 p 3 s 24 casts response to a hash M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 18 5 48 0 49 1 0 5 45 2 3 47 49 4 1 49 5 1 11 I 4 I 0 I 0 I 0 I -2 p 6 x 8 response x 7 to_hash x 4 Hash n x 4 be_a x 6 should p 3 I 0 I 45 I 12 x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 x 2 it p 3 I 0 I 44 I b x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 s 7 #valid? M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 22 5 7 0 64 56 1 47 50 2 1 15 5 7 3 64 56 4 47 50 2 1 11 I 4 I 0 I 0 I 0 I -2 p 5 s 22 when HTTP status is OK M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 11 5 7 0 64 56 1 47 50 2 1 11 I 4 I 0 I 0 I 0 I -2 p 3 s 12 returns true M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 10 5 48 0 5 48 1 49 2 1 11 I 3 I 0 I 0 I 0 I -2 p 3 x 8 response x 8 be_valid x 6 should p 3 I 0 I 4c I a x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 x 2 it p 3 I 0 I 4b I b x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 x 7 context s 26 when HTTP status is not OK M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 11 5 7 0 64 56 1 47 50 2 1 11 I 4 I 0 I 0 I 0 I -2 p 3 s 13 returns false M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 23 5 48 0 7 1 13 18 2 49 2 1 15 15 5 48 0 5 48 3 49 4 1 11 I 4 I 0 I 0 I 0 I -2 p 5 x 8 response I 193 x 5 code= x 8 be_valid x 10 should_not p 5 I 0 I 52 I d I 53 I 17 x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 x 2 it p 3 I 0 I 51 I b x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 p 5 I 0 I 4a I b I 50 I 16 x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 s 4 #xml M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 11 5 7 0 64 56 1 47 50 2 1 11 I 4 I 0 I 0 I 0 I -2 p 3 s 27 returns a Nokogiri document M 1 p 2 x 9 for_block t n x 13 AmazonProduct i 22 5 48 0 49 1 0 5 45 2 3 43 4 43 5 47 49 6 1 49 7 1 11 I 4 I 0 I 0 I 0 I -2 p 8 x 8 response x 3 xml x 8 Nokogiri n x 3 XML x 8 Document x 17 be_an_instance_of x 6 should p 3 I 0 I 5a I 16 x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 x 2 it p 3 I 0 I 59 I b x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 p 19 I 0 I 5 I a I b I 15 I 18 I 20 I 26 I 2b I 36 I 36 I 3c I 41 I 43 I 4c I 49 I 57 I 58 I 62 x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 x 8 describe p 3 I 2 I 4 I d x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0 x 13 attach_method p 5 I 0 I 1 I 9 I 3 I 25 x 75 /Users/hakanensari/code/amazon_product/spec/amazon_product/response_spec.rb p 0