tomato_power 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -53,6 +53,11 @@ module TomatoPower
|
|
53
53
|
{
|
54
54
|
:url => "dvds/upcoming.json?",
|
55
55
|
:whitelist => [:page, :page_limit, :country]
|
56
|
+
},
|
57
|
+
:movie_info =>
|
58
|
+
{
|
59
|
+
:url => ".json?",
|
60
|
+
:whitelist => [:movie_id]
|
56
61
|
},
|
57
62
|
:movie_cast =>
|
58
63
|
{
|
@@ -72,7 +77,7 @@ module TomatoPower
|
|
72
77
|
:movie_similar =>
|
73
78
|
{
|
74
79
|
:url => "/similar.json?",
|
75
|
-
:whitelist => [:movie_id]
|
80
|
+
:whitelist => [:movie_id, :limit]
|
76
81
|
},
|
77
82
|
:movie_alias =>
|
78
83
|
{
|
@@ -4,12 +4,14 @@ module TomatoPower
|
|
4
4
|
|
5
5
|
attr_reader :id, :info, :title, :ratings, :mpaa_rating,
|
6
6
|
:runtime,:release_dates, :synopsis, :alternate_ids, :links,
|
7
|
-
:studio, :directors
|
7
|
+
:studio, :directors, :year, :genres, :critics_consensus
|
8
8
|
|
9
9
|
def initialize movie={}
|
10
|
-
@info = movie
|
11
10
|
@id = movie["id"]
|
12
11
|
@title = movie["title"]
|
12
|
+
@year = movie["year"]
|
13
|
+
@genres = movie["genres"]
|
14
|
+
@critics_consensus = movie["critics_consensus"]
|
13
15
|
@mpaa_rating = movie["mpaa_rating"]
|
14
16
|
@runtime = movie["runtime"]
|
15
17
|
@release_dates = movie["release_dates"]
|
@@ -28,6 +30,7 @@ module TomatoPower
|
|
28
30
|
|
29
31
|
# Aliased API methods for a better interface.
|
30
32
|
MOVIE_METHOD_ALIAS = {
|
33
|
+
:info => :movie_info,
|
31
34
|
:full_cast => :movie_cast,
|
32
35
|
:clips => :movie_clips,
|
33
36
|
:reviews => :movie_reviews,
|
data/lib/tomato_power/version.rb
CHANGED
@@ -21,19 +21,26 @@ module TomatoPower
|
|
21
21
|
end
|
22
22
|
|
23
23
|
describe "valid methods" do
|
24
|
-
|
24
|
+
describe "list methods" do
|
25
|
+
valid_api_methods = [:movies_search, :upcoming_dvds,
|
26
|
+
:opening_movies]
|
25
27
|
|
26
|
-
|
27
|
-
|
28
|
-
|
28
|
+
it "should create methods" do
|
29
|
+
valid_api_methods.each do |method|
|
30
|
+
expect{ @api.send method }.not_to raise_error(NoMethodError)
|
31
|
+
end
|
29
32
|
end
|
30
33
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
34
|
+
it "should respond" do
|
35
|
+
valid_api_methods.each do |method|
|
36
|
+
expect { respond_to? method}.to be_true
|
37
|
+
end
|
35
38
|
end
|
36
39
|
end
|
40
|
+
|
41
|
+
describe "movie methods" do
|
42
|
+
|
43
|
+
end
|
37
44
|
end
|
38
45
|
end
|
39
46
|
|
@@ -59,6 +66,13 @@ module TomatoPower
|
|
59
66
|
@movie = TomatoPower::Movie.new TestHelpers::sample :movie
|
60
67
|
end
|
61
68
|
|
69
|
+
describe "info" do
|
70
|
+
it "should return info of movie" do
|
71
|
+
movie = @api.movie_info({:movie_id => @movie.id})
|
72
|
+
movie[0].should be_kind_of(Movie)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
62
76
|
describe "cast" do
|
63
77
|
it "should return cast of movie" do
|
64
78
|
cast = @api.movie_cast({:movie_id => @movie.id})
|
@@ -12,6 +12,9 @@ module TomatoPower
|
|
12
12
|
describe "attributes" do
|
13
13
|
it { should respond_to(:id)}
|
14
14
|
it { should respond_to(:info)}
|
15
|
+
it { should respond_to(:year)}
|
16
|
+
it { should respond_to(:critics_consensus)}
|
17
|
+
it { should respond_to(:genres)}
|
15
18
|
it { should respond_to(:title)}
|
16
19
|
it { should respond_to(:ratings)}
|
17
20
|
it { should respond_to(:mpaa_rating)}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tomato_power
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02
|
12
|
+
date: 2013-03-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|