google_business_api_url_signer 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 235f375e86196c98dd7c0bc7b2ef6b8764bd489b
4
- data.tar.gz: 2558fd60016006300e677f5bc49a54b5a8375469
3
+ metadata.gz: d859b39cf4e7e93c7849226802d8d8efc21f1c60
4
+ data.tar.gz: d99c18313c1cc820de0032eac5505f52460dfe1a
5
5
  SHA512:
6
- metadata.gz: 565bcf012f9250d0fac77b28fddc50a56f41a848d380a177502e5b6191afd17870244fa7a50f2c88f078a69c36b3be2edcf9745c2f5a82a18e80943c2062ed5f
7
- data.tar.gz: ca4a573a8c937edea77e314d1ccf0792e367f780fde106d840630164e49dbeece26acd573d0e9faed28d0488853d0473486e73cc641d037387bcee3b87dbc3f1
6
+ metadata.gz: 7a5a5352bdd5f82bad226698616e13b38aa8da5595005832fe88d361e1e52309d29c16c7c3b273e8dbb73a8d15342dcef1239683c806d168b475f75467f1da1a
7
+ data.tar.gz: 8cf7d649ebcc3f229c020a82ccb68869cb0d90fa136488a870f0507aecdd0fbda7a0b3b8df2b27ab9f4de41f68ff6206d297db4f764b755e5323a448c8df7b28
data/.travis.yml CHANGED
@@ -3,6 +3,7 @@ rvm:
3
3
  - 2.0.0
4
4
  - 2.1.0
5
5
  - 2.1.2
6
+ - 2.1.5
6
7
  - ruby-head
7
8
  - jruby-19mode
8
9
  - jruby
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = GoogleBusinessApiUrlSigner::VERSION
17
17
 
18
- gem.add_dependency "activesupport", [">= 3.2.0", "< 4.2"]
19
- gem.add_development_dependency "rspec", "2.11.0"
18
+ gem.add_dependency "activesupport", [">= 3.2.0", "~> 4.2.0"]
19
+ gem.add_development_dependency "rspec", "3.1.0"
20
20
  gem.add_development_dependency "rake"
21
21
  end
@@ -1,3 +1,3 @@
1
1
  module GoogleBusinessApiUrlSigner
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -13,11 +13,25 @@ describe GoogleBusinessApiUrlSigner::Signer do
13
13
  )
14
14
  end
15
15
 
16
- its(:url) { should eq url }
17
- its(:private_key) { should eq private_key }
18
- its(:signature) { should eq signature }
19
- its(:signed_url) { should eq signed_url }
20
- its(:signed_url) { should be_html_safe }
16
+ it "has expected URL" do
17
+ expect(subject.url).to eq url
18
+ end
19
+
20
+ it "has expected private key" do
21
+ expect(subject.private_key).to eq private_key
22
+ end
23
+
24
+ it "has expected signature" do
25
+ expect(subject.signature).to eq signature
26
+ end
27
+
28
+ it "has expected signed url" do
29
+ expect(subject.signed_url).to eq signed_url
30
+ end
31
+
32
+ it "has expected signed url to be HTML safe" do
33
+ expect(subject.signed_url).to be_html_safe
34
+ end
21
35
 
22
36
  it "ensures that the URL contains a client id" do
23
37
  expect {
@@ -44,14 +58,14 @@ describe GoogleBusinessApiUrlSigner::Signer do
44
58
  it "uses default private key when set" do
45
59
  described_class.default_private_key = 'default'
46
60
 
47
- Base64.should_receive(:urlsafe_decode64).with('default').and_return 'decoded'
61
+ expect(Base64).to receive(:urlsafe_decode64).with('default').and_return 'decoded'
48
62
  described_class.new(url: url).signature
49
63
  end
50
64
 
51
65
  it "uses the private key when options are filled with a blank private key" do
52
66
  described_class.default_private_key = 'default'
53
67
 
54
- Base64.should_receive(:urlsafe_decode64).with('default').and_return 'decoded'
68
+ expect(Base64).to receive(:urlsafe_decode64).with('default').and_return 'decoded'
55
69
  described_class.new(url: url, private_key: nil).signature
56
70
  end
57
71
  end
@@ -2,19 +2,20 @@ require 'spec_helper'
2
2
 
3
3
  describe GoogleBusinessApiUrlSigner do
4
4
  describe ".add_signature" do
5
- let(:signer) { mock }
5
+ let(:signer) { double }
6
6
  let(:private_key) { "vNIXE0xscrmjlyV-12Nj_BvUPaw=" }
7
7
  let(:url) { "http://maps.googleapis.com/maps/api/geocode/json?address=New+York&sensor=false&client=clientID" }
8
8
  let(:signed_url) { "http://maps.googleapis.com/maps/api/geocode/json?address=New+York&sensor=false&client=clientID&signature=KrU1TzVQM7Ur0i8i7K3huiw3MsA=" }
9
9
 
10
10
  it "delegates to signer" do
11
- GoogleBusinessApiUrlSigner::Signer.should_receive(:new).with(hash_including(
11
+ expect(GoogleBusinessApiUrlSigner::Signer).to receive(:new).with(hash_including(
12
12
  url: url,
13
13
  private_key: private_key
14
14
  )).and_return signer
15
- signer.should_receive(:signed_url).and_return signed_url
16
15
 
17
- described_class.add_signature(url, private_key).should eq signed_url
16
+ expect(signer).to receive(:signed_url).and_return signed_url
17
+
18
+ expect(described_class.add_signature(url, private_key)).to eq signed_url
18
19
  end
19
20
  end
20
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_business_api_url_signer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thorbjørn Hermansen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-15 00:00:00.000000000 Z
11
+ date: 2015-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -17,9 +17,9 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.2.0
20
- - - "<"
20
+ - - "~>"
21
21
  - !ruby/object:Gem::Version
22
- version: '4.2'
22
+ version: 4.2.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,23 +27,23 @@ dependencies:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: 3.2.0
30
- - - "<"
30
+ - - "~>"
31
31
  - !ruby/object:Gem::Version
32
- version: '4.2'
32
+ version: 4.2.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rspec
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - '='
38
38
  - !ruby/object:Gem::Version
39
- version: 2.11.0
39
+ version: 3.1.0
40
40
  type: :development
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - '='
45
45
  - !ruby/object:Gem::Version
46
- version: 2.11.0
46
+ version: 3.1.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  version: '0'
99
99
  requirements: []
100
100
  rubyforge_project:
101
- rubygems_version: 2.2.2
101
+ rubygems_version: 2.4.5
102
102
  signing_key:
103
103
  specification_version: 4
104
104
  summary: Signs URLs used to call Google's business APIs