quanto-ruby 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/quanto/entries.rb +4 -0
- data/lib/quanto/version.rb +1 -1
- data/spec/quanto_client_spec.rb +8 -10
- data/spec/spec_helper.rb +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b0b2421490e6e7576d41ff5a5a97c134946af60
|
4
|
+
data.tar.gz: c8a52bac55b8e48da94a8cbe0216b9a8c04d1565
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 634d4ac35a850cfd1ff367c3bb4f6852161c0f11e013d7f26b43aadfb6f9d12ad1fb09b4d8ba173b31c94e46a4452aa33e1ec6e45cc119ea1fa6e128a7be88b3
|
7
|
+
data.tar.gz: f65a0080fdc5b229d409d57a3464326837733698cb687bd3bcda17e00f35a5c098fa792dc96d7f503b46fa0d1a931f3c67041df799b2c51ee07fa080ee466392
|
data/lib/quanto/entries.rb
CHANGED
data/lib/quanto/version.rb
CHANGED
data/spec/quanto_client_spec.rb
CHANGED
@@ -12,17 +12,17 @@ describe Quanto::Client do
|
|
12
12
|
let(:client) { Quanto::Client.new(consumer_key, consumer_secret, options) }
|
13
13
|
|
14
14
|
it 'constructs an OAuth2 consumer' do
|
15
|
-
OAuth2::Client.
|
15
|
+
expect(OAuth2::Client).to receive(:new)
|
16
16
|
Quanto::Client.new(consumer_key, consumer_secret)
|
17
17
|
end
|
18
18
|
|
19
19
|
it 'passes consumer credentials' do
|
20
|
-
OAuth2::Client.
|
20
|
+
expect(OAuth2::Client).to receive(:new).with(consumer_key, consumer_secret, anything)
|
21
21
|
Quanto::Client.new(consumer_key, consumer_secret)
|
22
22
|
end
|
23
23
|
|
24
24
|
it 'passes the quanto URL' do
|
25
|
-
OAuth2::Client.
|
25
|
+
expect(OAuth2::Client).to receive(:new) do |key, secret, options|
|
26
26
|
expect(options[:site]).to eq('http://quanto.herokuapp.com')
|
27
27
|
end
|
28
28
|
Quanto::Client.new(consumer_key, consumer_secret)
|
@@ -48,15 +48,13 @@ describe Quanto::Client do
|
|
48
48
|
let(:options) { { access_token: 'token' } }
|
49
49
|
|
50
50
|
it 'creates an access token' do
|
51
|
-
OAuth2::AccessToken.
|
51
|
+
expect(OAuth2::AccessToken).to receive(:new)
|
52
52
|
client.send(:access_token)
|
53
53
|
end
|
54
54
|
|
55
55
|
it 'passes the consumer' do
|
56
|
-
OAuth2::AccessToken
|
57
|
-
|
58
|
-
.with(anything, options[:access_token])
|
59
|
-
client.stub(:consumer).and_return(double('OAuth2::Client'))
|
56
|
+
expect(OAuth2::AccessToken).to receive(:new).with(anything, options[:access_token])
|
57
|
+
allow(client).to receive(:consumer).and_return(double('OAuth2::Client'))
|
60
58
|
client.send(:access_token)
|
61
59
|
end
|
62
60
|
|
@@ -70,13 +68,13 @@ describe Quanto::Client do
|
|
70
68
|
let(:token) { double('OAuth2::AccessToken') }
|
71
69
|
|
72
70
|
before(:each) do
|
73
|
-
client.
|
71
|
+
allow(client).to receive(:access_token).and_return(token)
|
74
72
|
end
|
75
73
|
|
76
74
|
it 'prepends /api/v1' do
|
77
75
|
path = 'foo'
|
78
76
|
prefix = "/api/v1/"
|
79
|
-
token.
|
77
|
+
expect(token).to receive(:post).with("#{prefix}#{path}", anything)
|
80
78
|
client.send(:post, path, {})
|
81
79
|
end
|
82
80
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quanto-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rasmus Rygaard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oauth2
|