tmdb-api 0.0.4 → 0.0.5

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.
@@ -4,7 +4,7 @@ describe TMDb::Searchable do
4
4
  describe ".search" do
5
5
  it "searches movies given only the movie name" do
6
6
  stub_get('/search/movie').with(query: { query: 'The Lord of the Rings' })
7
- .to_return(json_response('search_movie_by_name.json'))
7
+ .to_return(json_response('searchable/search_movie_by_name.json'))
8
8
 
9
9
  movies = TMDb::Movie.search("The Lord of the Rings")
10
10
 
@@ -22,6 +22,21 @@ describe TMDb::Searchable do
22
22
  expect(movies.first.vote_count).to eq(187)
23
23
  end
24
24
 
25
+ it "searches for a person given a name" do
26
+ stub_get('/search/person').with(query: { query: 'Peter Jackson' })
27
+ .to_return(json_response('searchable/search_person_by_name.json'))
28
+
29
+ people = TMDb::Person.search('Peter Jackson')
30
+
31
+ expect(people).to have(3).items
32
+
33
+ expect(people.first.adult).to eq(false)
34
+ expect(people.first.id).to eq(108)
35
+ expect(people.first.name).to eq("Peter Jackson")
36
+ expect(people.first.popularity).to eq(3.411923015718)
37
+ expect(people.first.profile_path).to eq("/8MN8C1w1wuEHMxdvDqHP5bDFMh.jpg")
38
+ end
39
+
25
40
  it 'raises with a bad request' do
26
41
  stub_get('/search/movie').with(query: { query: 'Iron Man' })
27
42
  .to_return(status: 404)
@@ -1,13 +1,19 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe TMDb do
4
- it "sets a API Key" do
4
+ it "sets an API Key" do
5
5
  TMDb.api_key = '74e5e63643c787867565659583634766'
6
6
  expect(TMDb.api_key).to eql('74e5e63643c787867565659583634766')
7
7
  end
8
8
 
9
- it 'raises when use no API' do
9
+ it 'raises when no API Key is set' do
10
10
  TMDb.api_key = ''
11
11
  expect { TMDb::Movie.find(550) }.to raise_error
12
12
  end
13
+
14
+ it 'accepts the API Key from the environment variable' do
15
+ TMDb.api_key = nil
16
+ ENV['TMDB_API_KEY'] = '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
17
+ expect(TMDb.api_key).to eql('0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33')
18
+ end
13
19
  end
metadata CHANGED
@@ -1,52 +1,46 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tmdb-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
5
- prerelease:
4
+ version: 0.0.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Andriel Nuernberg
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-08-10 00:00:00.000000000 Z
11
+ date: 2013-11-13 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: httparty
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: activesupport
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: bundler
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
@@ -62,65 +55,57 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rake
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rspec
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - '>='
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: webmock
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - '>='
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - '>='
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: pry
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - '>='
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - '>='
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
111
  description: The Movie Database API v3
@@ -142,7 +127,9 @@ files:
142
127
  - lib/tmdb-api/changes.rb
143
128
  - lib/tmdb-api/genre.rb
144
129
  - lib/tmdb-api/httparty.rb
130
+ - lib/tmdb-api/inflections.rb
145
131
  - lib/tmdb-api/movie.rb
132
+ - lib/tmdb-api/person.rb
146
133
  - lib/tmdb-api/production_company.rb
147
134
  - lib/tmdb-api/production_country.rb
148
135
  - lib/tmdb-api/searchable.rb
@@ -150,56 +137,73 @@ files:
150
137
  - lib/tmdb-api/version.rb
151
138
  - spec/fixtures/changes/movies.json
152
139
  - spec/fixtures/movie/alternative_titles.json
140
+ - spec/fixtures/movie/cast.json
141
+ - spec/fixtures/movie/crew.json
153
142
  - spec/fixtures/movie/find.json
154
143
  - spec/fixtures/movie/images.json
155
144
  - spec/fixtures/movie/keywords.json
156
145
  - spec/fixtures/movie/releases.json
146
+ - spec/fixtures/movie/trailers.json
157
147
  - spec/fixtures/movie/upcoming.json
158
- - spec/fixtures/search_movie_by_name.json
148
+ - spec/fixtures/person/find.json
149
+ - spec/fixtures/person/images.json
150
+ - spec/fixtures/person/popular.json
151
+ - spec/fixtures/person/popular_pages.json
152
+ - spec/fixtures/searchable/search_movie_by_name.json
153
+ - spec/fixtures/searchable/search_person_by_name.json
159
154
  - spec/spec_helper.rb
160
155
  - spec/support/stubber.rb
161
156
  - spec/tmdb-api/change_spec.rb
162
157
  - spec/tmdb-api/movie_spec.rb
158
+ - spec/tmdb-api/person_spec.rb
163
159
  - spec/tmdb-api/searchable_spec.rb
164
160
  - spec/tmdb-api/tmdb_spec.rb
165
161
  - tmdb-api.gemspec
166
162
  homepage: https://github.com/andrielfn/tmdb-api
167
163
  licenses:
168
164
  - MIT
165
+ metadata: {}
169
166
  post_install_message:
170
167
  rdoc_options: []
171
168
  require_paths:
172
169
  - lib
173
170
  required_ruby_version: !ruby/object:Gem::Requirement
174
- none: false
175
171
  requirements:
176
- - - ! '>='
172
+ - - '>='
177
173
  - !ruby/object:Gem::Version
178
174
  version: '0'
179
175
  required_rubygems_version: !ruby/object:Gem::Requirement
180
- none: false
181
176
  requirements:
182
- - - ! '>='
177
+ - - '>='
183
178
  - !ruby/object:Gem::Version
184
179
  version: '0'
185
180
  requirements: []
186
181
  rubyforge_project:
187
- rubygems_version: 1.8.23
182
+ rubygems_version: 2.0.3
188
183
  signing_key:
189
- specification_version: 3
184
+ specification_version: 4
190
185
  summary: The Mobie Database API v3
191
186
  test_files:
192
187
  - spec/fixtures/changes/movies.json
193
188
  - spec/fixtures/movie/alternative_titles.json
189
+ - spec/fixtures/movie/cast.json
190
+ - spec/fixtures/movie/crew.json
194
191
  - spec/fixtures/movie/find.json
195
192
  - spec/fixtures/movie/images.json
196
193
  - spec/fixtures/movie/keywords.json
197
194
  - spec/fixtures/movie/releases.json
195
+ - spec/fixtures/movie/trailers.json
198
196
  - spec/fixtures/movie/upcoming.json
199
- - spec/fixtures/search_movie_by_name.json
197
+ - spec/fixtures/person/find.json
198
+ - spec/fixtures/person/images.json
199
+ - spec/fixtures/person/popular.json
200
+ - spec/fixtures/person/popular_pages.json
201
+ - spec/fixtures/searchable/search_movie_by_name.json
202
+ - spec/fixtures/searchable/search_person_by_name.json
200
203
  - spec/spec_helper.rb
201
204
  - spec/support/stubber.rb
202
205
  - spec/tmdb-api/change_spec.rb
203
206
  - spec/tmdb-api/movie_spec.rb
207
+ - spec/tmdb-api/person_spec.rb
204
208
  - spec/tmdb-api/searchable_spec.rb
205
209
  - spec/tmdb-api/tmdb_spec.rb