vacuum 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +11 -113
- data/lib/vacuum/request.rb +66 -0
- data/lib/vacuum/version.rb +1 -1
- data/lib/vacuum.rb +5 -38
- data/test/request_test.rb +18 -0
- metadata +24 -96
- data/lib/vacuum/endpoint/base.rb +0 -58
- data/lib/vacuum/endpoint/mws.rb +0 -59
- data/lib/vacuum/endpoint/product_advertising.rb +0 -34
- data/lib/vacuum/mws.rb +0 -8
- data/lib/vacuum/product_advertising.rb +0 -7
- data/lib/vacuum/request/base.rb +0 -109
- data/lib/vacuum/request/mws.rb +0 -24
- data/lib/vacuum/request/product_advertising.rb +0 -101
- data/lib/vacuum/request/signature/authentication.rb +0 -32
- data/lib/vacuum/request/signature/builder.rb +0 -70
- data/lib/vacuum/request/utils.rb +0 -24
- data/lib/vacuum/response/base.rb +0 -57
- data/lib/vacuum/response/mws.rb +0 -7
- data/lib/vacuum/response/product_advertising.rb +0 -19
- data/lib/vacuum/response/utils.rb +0 -48
- data/spec/fixtures/product_advertising +0 -1
- data/spec/spec_helper.rb +0 -15
- data/spec/support/shared_examples/endpoint.rb +0 -43
- data/spec/support/shared_examples/request.rb +0 -142
- data/spec/support/shared_examples/response.rb +0 -51
- data/spec/vacuum/endpoint/base_spec.rb +0 -19
- data/spec/vacuum/endpoint/mws_spec.rb +0 -47
- data/spec/vacuum/endpoint/product_advertising_spec.rb +0 -25
- data/spec/vacuum/request/base_spec.rb +0 -22
- data/spec/vacuum/request/mws_spec.rb +0 -26
- data/spec/vacuum/request/product_advertising_spec.rb +0 -118
- data/spec/vacuum/request/signature/authentication_spec.rb +0 -30
- data/spec/vacuum/request/signature/builder_spec.rb +0 -76
- data/spec/vacuum/request/utils_spec.rb +0 -23
- data/spec/vacuum/response/base_spec.rb +0 -38
- data/spec/vacuum/response/product_advertising_spec.rb +0 -57
- data/spec/vacuum/response/utils_spec.rb +0 -42
@@ -1,42 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Vacuum
|
4
|
-
module Response
|
5
|
-
describe Utils do
|
6
|
-
describe '.xml_to_hash' do
|
7
|
-
let(:hash) do
|
8
|
-
str = <<-XML.gsub!(/>\s+</, '><').strip!
|
9
|
-
<?xml version=\"1.0\" ?>
|
10
|
-
<ItemAttributes>
|
11
|
-
<Title>Anti-Oedipus</Title>
|
12
|
-
<Author>Gilles Deleuze</Author>
|
13
|
-
<Author>Felix Guattari</Author>
|
14
|
-
<Creator Role="Translator">Robert Hurley</Creator>
|
15
|
-
</ItemAttributes>
|
16
|
-
XML
|
17
|
-
xml = Nokogiri::XML.parse str
|
18
|
-
|
19
|
-
Utils.xml_to_hash xml
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'returns a hash' do
|
23
|
-
hash.should be_an_instance_of Hash
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'handles only childs' do
|
27
|
-
hash['Title'].should eql 'Anti-Oedipus'
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'handles arrays' do
|
31
|
-
hash['Author'].should be_a Array
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'handles attributes' do
|
35
|
-
node = hash['Creator']
|
36
|
-
node['Role'].should eql 'Translator'
|
37
|
-
node['__content__'].should eql 'Robert Hurley'
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|