tomato_power 0.1.3 → 0.1.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.
@@ -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,7 +4,7 @@ module TomatoPower
4
4
  attr_reader :title, :duration, :thumbnail, :link
5
5
  def initialize clip={}
6
6
  @title = clip["title"]
7
- @duration = clip["duration"]
7
+ @duration = clip["duration"]
8
8
  @thumbnail = clip["thumbnail"]
9
9
  @link = clip["links"]["alternate"]
10
10
  end
@@ -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,
@@ -1,3 +1,3 @@
1
1
  module TomatoPower
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -21,19 +21,26 @@ module TomatoPower
21
21
  end
22
22
 
23
23
  describe "valid methods" do
24
- valid_api_methods = [:movies_search, :upcoming_dvds, :opening_movies]
24
+ describe "list methods" do
25
+ valid_api_methods = [:movies_search, :upcoming_dvds,
26
+ :opening_movies]
25
27
 
26
- it "should create methods" do
27
- valid_api_methods.each do |method|
28
- expect{ @api.send method }.not_to raise_error(NoMethodError)
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
- end
32
- it "should respond" do
33
- valid_api_methods.each do |method|
34
- expect { respond_to? method}.to be_true
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.3
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-27 00:00:00.000000000 Z
12
+ date: 2013-03-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport