alexa 0.6.3 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,14 +0,0 @@
1
- HTTP/1.1 200 OK
2
- Server: Apache-Coyote/1.1
3
- Content-Type: text/xml
4
- Transfer-Encoding: chunked
5
- Date: Wed, 12 Oct 2011 21:18:48 GMT
6
-
7
- <?xml version="1.0"?>
8
- <aws:UrlInfoResponse xmlns:aws="http://alexa.amazonaws.com/doc/2005-07-11/"><aws:Response xmlns:aws="http://awis.amazonaws.com/doc/2005-07-11"><aws:OperationRequest><aws:RequestId>b9574986-bda8-83e2-cc0b-41457a7168d0</aws:RequestId></aws:OperationRequest><aws:UrlInfoResult><aws:Alexa>
9
-
10
- <aws:TrafficData>
11
- <aws:DataUrl type="canonical">github.com/</aws:DataUrl>
12
- <aws:Rank>551</aws:Rank>
13
- </aws:TrafficData>
14
- </aws:Alexa></aws:UrlInfoResult><aws:ResponseStatus xmlns:aws="http://alexa.amazonaws.com/doc/2005-07-11/"><aws:StatusCode>Success</aws:StatusCode></aws:ResponseStatus></aws:Response></aws:UrlInfoResponse>
@@ -1,22 +0,0 @@
1
- require "minitest/autorun"
2
- require "webmock/minitest"
3
- require "mocha/setup"
4
-
5
- require "alexa"
6
-
7
- xml_parser = ENV["XML_PARSER"] || "libxml"
8
-
9
- require xml_parser if ["nokogiri", "libxml", "ox"].include?(xml_parser)
10
- MultiXml.parser = xml_parser
11
-
12
- class MiniTest::Test
13
- def setup
14
- WebMock.disable_net_connect!
15
- end
16
-
17
- # Recording response is as simple as writing in terminal:
18
- # curl -is -X GET "http://awis.amazonaws.com/?Action=UrlInfo&AWSAccessKeyId=fake" > response.txt
19
- def fixture(filename)
20
- File.read(File.join("test", "fixtures", filename))
21
- end
22
- end
@@ -1,54 +0,0 @@
1
- require "helper"
2
-
3
- describe Alexa::Utils do
4
- describe "#safe_retrieve" do
5
- it "returns nested hash value" do
6
- hash = {:first => {:second => {:third => "Value!"}}}
7
- assert_equal "Value!", Alexa::Utils.safe_retrieve(hash, :first, :second, :third)
8
- end
9
-
10
- it "returns partial hash when not all keys given" do
11
- hash = {:first => {:second => {:third => "Value!"}}}
12
- assert_equal({:third => "Value!"}, Alexa::Utils.safe_retrieve(hash, :first, :second))
13
- end
14
-
15
- it "returns nil when key not found in hash" do
16
- hash = {:first => {:second => {:third => "Value!"}}}
17
- assert_nil Alexa::Utils.safe_retrieve(hash, :non_exisiting)
18
- end
19
-
20
- it "returns nil when one of keys not found in hash" do
21
- hash = {:first => {:second => {:third => "Value!"}}}
22
- assert_nil Alexa::Utils.safe_retrieve(hash, :first, :non_exisiting)
23
- end
24
-
25
- it "returns nil when given more keys than present in hash" do
26
- hash = {:first => {:second => {:third => "Value!"}}}
27
- assert_nil Alexa::Utils.safe_retrieve(hash, :first, :second, :third, :fourth)
28
- end
29
-
30
- it "returns nil when non hash object given" do
31
- assert_nil Alexa::Utils.safe_retrieve("And Now for Something Completely Different")
32
- end
33
-
34
- it "returns nil when no keys given" do
35
- hash = {:first => {:second => {:third => "Value!"}}}
36
- assert_nil Alexa::Utils.safe_retrieve(hash)
37
- end
38
-
39
- it "does not return incidental value" do
40
- hash = {nil => "value"}
41
- assert_nil Alexa::Utils.safe_retrieve(hash)
42
- end
43
- end
44
-
45
- describe "#camelize" do
46
- it "uppercases word" do
47
- assert_equal "Big", Alexa::Utils.camelize("big")
48
- end
49
-
50
- it "removes underscores" do
51
- assert_equal "BigBen", Alexa::Utils.camelize("big_ben")
52
- end
53
- end
54
- end