spotlite 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/spotlite/movie.rb +3 -1
- data/lib/spotlite/version.rb +1 -1
- data/spec/fixtures/search_name_count_50 +1308 -0
- data/spec/fixtures/search_title_count_50 +1407 -0
- data/spec/fixtures/{tt0133093 → tt0120338}/technical +136 -117
- data/spec/spec_helper.rb +3 -1
- data/spec/spotlite/movie_spec.rb +34 -5
- data/spec/spotlite/person_spec.rb +27 -0
- metadata +8 -4
data/spec/spec_helper.rb
CHANGED
@@ -17,7 +17,7 @@ IMDB_SAMPLES = {
|
|
17
17
|
'http://www.imdb.com/title/tt0133093/releaseinfo' => 'tt0133093/releaseinfo',
|
18
18
|
'http://www.imdb.com/title/tt0133093/trivia' => 'tt0133093/trivia',
|
19
19
|
'http://www.imdb.com/title/tt0133093/criticreviews' => 'tt0133093/criticreviews',
|
20
|
-
'http://www.imdb.com/title/
|
20
|
+
'http://www.imdb.com/title/tt0120338/technical' => 'tt0120338/technical',
|
21
21
|
'http://www.imdb.com/title/tt0317248/' => 'tt0317248/index',
|
22
22
|
'http://www.imdb.com/title/tt0169547/' => 'tt0169547/index',
|
23
23
|
'http://www.imdb.com/title/tt0112873/' => 'tt0112873/index',
|
@@ -28,6 +28,8 @@ IMDB_SAMPLES = {
|
|
28
28
|
'http://www.imdb.com/find?q=wappadoozle+swambling&s=tt&ttype=ft' => 'movie_find_no_results',
|
29
29
|
'http://www.imdb.com/find?q=herpinson+derpington&s=nm' => 'person_find_no_results',
|
30
30
|
'http://www.imdb.com/find?q=conan&s=nm' => 'person_find_conan',
|
31
|
+
'http://www.imdb.com/search/title?count=50&title_type=feature&view=simple&start=1&sort=moviemeter,asc' => 'search_title_count_50',
|
32
|
+
'http://www.imdb.com/search/name?count=50&view=simple&start=1&gender=male,female&sort=starmeter,asc' => 'search_name_count_50',
|
31
33
|
'http://www.imdb.com/name/nm0000233/?nmdp=1' => 'nm0000233/index',
|
32
34
|
'http://www.imdb.com/name/nm0005132/?nmdp=1' => 'nm0005132/index',
|
33
35
|
'http://www.imdb.com/name/nm1659547/?nmdp=1' => 'nm1659547/index',
|
data/spec/spotlite/movie_spec.rb
CHANGED
@@ -183,13 +183,15 @@ describe "Spotlite::Movie" do
|
|
183
183
|
)
|
184
184
|
end
|
185
185
|
|
186
|
-
it "should return technical information" do
|
186
|
+
it "should return technical information as a hash of arrays" do
|
187
|
+
@movie = Spotlite::Movie.new("0120338")
|
187
188
|
hash = @movie.technical
|
188
189
|
hash.should be_a(Hash)
|
189
|
-
hash.should
|
190
|
-
hash.should include("
|
191
|
-
hash.should include("
|
192
|
-
hash.should include("
|
190
|
+
hash.each{|element| element.should be_an(Array)}
|
191
|
+
hash.should include("Runtime" => ["3 hr 14 min (194 min)"])
|
192
|
+
hash.should include("Sound Mix" => ["DTS 70 mm (70 mm prints)", "DTS", "Dolby Digital", "SDDS"])
|
193
|
+
hash.should include("Cinematographic Process" => ["Super 35", "Techniscope (underwater scenes)"])
|
194
|
+
hash.should include("Film Length" => ["5,340 m (Sweden)", "5,426 m (10 reels)"])
|
193
195
|
end
|
194
196
|
|
195
197
|
it "should return an array of still frames URLs" do
|
@@ -255,4 +257,31 @@ describe "Spotlite::Movie" do
|
|
255
257
|
|
256
258
|
end
|
257
259
|
|
260
|
+
describe "#find method" do
|
261
|
+
it "should return some movies" do
|
262
|
+
results = Spotlite::Movie.find("conan")
|
263
|
+
results.should be_an(Array)
|
264
|
+
results.size.should eql(200)
|
265
|
+
results.each{ |movie| movie.should be_a(Spotlite::Movie) }
|
266
|
+
first = results.first
|
267
|
+
first.title.should eql("Conan the Barbarian")
|
268
|
+
first.imdb_id.should eql("0816462")
|
269
|
+
end
|
270
|
+
|
271
|
+
it "should return no results" do
|
272
|
+
results = Spotlite::Movie.find("wappadoozle swambling")
|
273
|
+
results.should be_an(Array)
|
274
|
+
results.size.should eql(0)
|
275
|
+
end
|
276
|
+
end
|
277
|
+
|
278
|
+
describe "#search method" do
|
279
|
+
it "should return some movies" do
|
280
|
+
results = Spotlite::Movie.search({count: 50})
|
281
|
+
results.should be_an(Array)
|
282
|
+
results.size.should eql(50)
|
283
|
+
results.each{ |movie| movie.should be_a(Spotlite::Movie) }
|
284
|
+
end
|
285
|
+
end
|
286
|
+
|
258
287
|
end
|
@@ -105,4 +105,31 @@ describe "Spotlite::Person" do
|
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
108
|
+
describe "#find method" do
|
109
|
+
it "should return some people" do
|
110
|
+
results = Spotlite::Person.find("conan")
|
111
|
+
results.should be_an(Array)
|
112
|
+
results.size.should eql(200)
|
113
|
+
results.each{ |movie| movie.should be_a(Spotlite::Person) }
|
114
|
+
first = results.first
|
115
|
+
first.name.should eql("Alyssa Milano")
|
116
|
+
first.imdb_id.should eql("0000192")
|
117
|
+
end
|
118
|
+
|
119
|
+
it "should return no results" do
|
120
|
+
results = Spotlite::Person.find("herpinson derpington")
|
121
|
+
results.should be_an(Array)
|
122
|
+
results.size.should eql(0)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
describe "#search method" do
|
127
|
+
it "should return some people" do
|
128
|
+
results = Spotlite::Person.search({count: 50})
|
129
|
+
results.should be_an(Array)
|
130
|
+
results.size.should eql(50)
|
131
|
+
results.each{ |person| person.should be_a(Spotlite::Person) }
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
108
135
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spotlite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artem Pakk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -79,16 +79,18 @@ files:
|
|
79
79
|
- spec/fixtures/nm1659547/index
|
80
80
|
- spec/fixtures/person_find_conan
|
81
81
|
- spec/fixtures/person_find_no_results
|
82
|
+
- spec/fixtures/search_name_count_50
|
83
|
+
- spec/fixtures/search_title_count_50
|
82
84
|
- spec/fixtures/tt0002186/index
|
83
85
|
- spec/fixtures/tt0047396/releaseinfo
|
84
86
|
- spec/fixtures/tt0112873/index
|
87
|
+
- spec/fixtures/tt0120338/technical
|
85
88
|
- spec/fixtures/tt0133093/criticreviews
|
86
89
|
- spec/fixtures/tt0133093/fullcredits
|
87
90
|
- spec/fixtures/tt0133093/index
|
88
91
|
- spec/fixtures/tt0133093/keywords
|
89
92
|
- spec/fixtures/tt0133093/mediaindex_still_frame
|
90
93
|
- spec/fixtures/tt0133093/releaseinfo
|
91
|
-
- spec/fixtures/tt0133093/technical
|
92
94
|
- spec/fixtures/tt0133093/trivia
|
93
95
|
- spec/fixtures/tt0169547/index
|
94
96
|
- spec/fixtures/tt0317248/index
|
@@ -131,16 +133,18 @@ test_files:
|
|
131
133
|
- spec/fixtures/nm1659547/index
|
132
134
|
- spec/fixtures/person_find_conan
|
133
135
|
- spec/fixtures/person_find_no_results
|
136
|
+
- spec/fixtures/search_name_count_50
|
137
|
+
- spec/fixtures/search_title_count_50
|
134
138
|
- spec/fixtures/tt0002186/index
|
135
139
|
- spec/fixtures/tt0047396/releaseinfo
|
136
140
|
- spec/fixtures/tt0112873/index
|
141
|
+
- spec/fixtures/tt0120338/technical
|
137
142
|
- spec/fixtures/tt0133093/criticreviews
|
138
143
|
- spec/fixtures/tt0133093/fullcredits
|
139
144
|
- spec/fixtures/tt0133093/index
|
140
145
|
- spec/fixtures/tt0133093/keywords
|
141
146
|
- spec/fixtures/tt0133093/mediaindex_still_frame
|
142
147
|
- spec/fixtures/tt0133093/releaseinfo
|
143
|
-
- spec/fixtures/tt0133093/technical
|
144
148
|
- spec/fixtures/tt0133093/trivia
|
145
149
|
- spec/fixtures/tt0169547/index
|
146
150
|
- spec/fixtures/tt0317248/index
|