spec/integration/multiple_locales_spec.rb in sucker-1.0.0.beta.2 vs spec/integration/multiple_locales_spec.rb in sucker-1.0.0.beta.3

- old
+ new

@@ -9,12 +9,10 @@ locales = %w{us uk de ca fr jp} params = { "Operation" => "ItemLookup", "IdType" => "ASIN", - "Condition" => "All", - "MerchantId" => "All", "ResponseGroup" => "ItemAttributes", "ItemId" => "0816614024" } threads = locales.map do |locale| Thread.new do @@ -25,14 +23,13 @@ worker << params Thread.current[:response] = worker.get end end - bindings = [] - threads.each do |thread| + bindings = threads.map do |thread| thread.join - item = thread[:response].node("Item").first - bindings << item["ItemAttributes"]["Binding"] + item = thread[:response].find("Item").first + item["ItemAttributes"]["Binding"] end bindings.uniq.should =~ %w{ Paperback Taschenbuch Broché ペーパーバック } end end