viki 0.0.3 → 0.0.4
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.
- data/.gitignore +1 -0
- data/.rvmrc +1 -1
- data/lib/viki/client.rb +2 -2
- data/lib/viki/version.rb +1 -1
- data/spec/request_spec.rb +14 -6
- metadata +2 -2
data/.gitignore
CHANGED
data/.rvmrc
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rvm use ruby-1.9.3-
|
1
|
+
rvm use ruby-1.9.3-p194@viki-gem --create
|
data/lib/viki/client.rb
CHANGED
data/lib/viki/version.rb
CHANGED
data/spec/request_spec.rb
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
+
require 'secrets'
|
4
5
|
require 'filter_shared_examples_spec'
|
5
6
|
|
6
7
|
describe "Viki" do
|
7
|
-
let(:client_id) {
|
8
|
-
let(:client_secret) {
|
8
|
+
let(:client_id) { CLIENT_ID }
|
9
|
+
let(:client_secret) { CLIENT_SECRET }
|
9
10
|
|
10
11
|
describe "Auth" do
|
11
12
|
it "should retrieve an access token when the Viki object is configured and initialized" do
|
12
13
|
VCR.use_cassette "auth" do
|
13
14
|
client = Viki.new(client_id, client_secret)
|
14
|
-
client.access_token.
|
15
|
+
client.access_token.should_not be_nil
|
15
16
|
end
|
16
17
|
end
|
17
18
|
|
@@ -51,8 +52,6 @@ describe "Viki" do
|
|
51
52
|
"Require watchable_in parameter when given platform parameter")
|
52
53
|
end
|
53
54
|
end
|
54
|
-
|
55
|
-
#it_behaves_like "API with parameter filters"
|
56
55
|
end
|
57
56
|
|
58
57
|
describe "/movies/:id" do
|
@@ -160,10 +159,19 @@ describe "Viki" do
|
|
160
159
|
end
|
161
160
|
end
|
162
161
|
|
163
|
-
describe "
|
162
|
+
describe "Errors" do
|
164
163
|
it "should raise NoMethodError if a method that is not on the whitelist is called" do
|
165
164
|
expect { client.does_not_exist }.should raise_error(NoMethodError)
|
166
165
|
end
|
166
|
+
|
167
|
+
it "should use the proper call chain after a failed request" do
|
168
|
+
VCR.use_cassette "movie_error" do
|
169
|
+
lambda { client.movies(50).get }.should raise_error(Viki::Error, "The resource couldn't be found")
|
170
|
+
end
|
171
|
+
|
172
|
+
results = client.movies.get
|
173
|
+
results.should be_instance_of(Viki::APIObject)
|
174
|
+
end
|
167
175
|
end
|
168
176
|
end
|
169
177
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: viki
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-
|
14
|
+
date: 2012-07-03 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rspec
|