imdb 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/README.rdoc +5 -1
- data/VERSION +1 -1
- data/imdb.gemspec +4 -3
- data/lib/imdb/movie.rb +28 -4
- data/spec/fixtures/search_kannethirey_thondrinal +4 -4
- data/spec/fixtures/search_matrix_revolutions +4 -4
- data/spec/fixtures/search_star_trek +82 -61
- data/spec/fixtures/top_250 +33 -30
- data/spec/fixtures/tt0036855 +221 -165
- data/spec/fixtures/tt0083987 +247 -168
- data/spec/fixtures/tt0095016 +264 -197
- data/spec/fixtures/tt0110912 +1273 -0
- data/spec/fixtures/tt0111161 +262 -170
- data/spec/fixtures/tt0117731 +238 -199
- data/spec/fixtures/tt0242653 +256 -194
- data/spec/fixtures/tt0330508 +155 -79
- data/spec/fixtures/tt1352369 +242 -137
- data/spec/imdb/movie_spec.rb +34 -1
- data/spec/spec_helper.rb +2 -1
- metadata +39 -21
data/spec/imdb/movie_spec.rb
CHANGED
@@ -22,7 +22,24 @@ describe "Imdb::Movie" do
|
|
22
22
|
cast.should include("Bonnie Bedelia")
|
23
23
|
cast.should include("Alan Rickman")
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
|
+
describe 'fetching a list of imdb actor ids for the cast members' do
|
27
|
+
it 'should not require arguments' do
|
28
|
+
lambda { @movie.cast_member_ids }.should_not raise_error(ArgumentError)
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'should not allow arguments' do
|
32
|
+
lambda { @movie.cast_member_ids(:foo) }.should raise_error(ArgumentError)
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'should return the imdb actor number for each cast member' do
|
36
|
+
@movie.cast_member_ids.sort.should == [
|
37
|
+
"nm0000246", "nm0000889", "nm0001817", "nm0322339", "nm0924691", "nm0040472", "nm0000952",
|
38
|
+
"nm0793363", "nm0000614", "nm0324231", "nm0236525", "nm0936591", "nm0319739", "nm0687270", "nm0127960"
|
39
|
+
].sort
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
26
43
|
it "should find the director" do
|
27
44
|
@movie.director.should be_an(Array)
|
28
45
|
@movie.director.size.should eql(1)
|
@@ -145,5 +162,21 @@ describe "Imdb::Movie" do
|
|
145
162
|
it "should return nil as poster url" do
|
146
163
|
@movie.poster.should be_nil
|
147
164
|
end
|
165
|
+
|
166
|
+
it "should return the release date for movies" do
|
167
|
+
movie = Imdb::Movie.new('0111161')
|
168
|
+
movie.release_date.should eql("23 September 1994 (USA)")
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
describe "with an old poster (no @@)" do
|
173
|
+
before(:each) do
|
174
|
+
# Pulp Fiction (1994)
|
175
|
+
@movie = Imdb::Movie.new("0110912")
|
176
|
+
end
|
177
|
+
|
178
|
+
it "should have a poster" do
|
179
|
+
@movie.poster.should eql("http://ia.media-imdb.com/images/M/MV5BMjE0ODk2NjczOV5BMl5BanBnXkFtZTYwNDQ0NDg4.jpg")
|
180
|
+
end
|
148
181
|
end
|
149
182
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -36,7 +36,8 @@ IMDB_SAMPLES = {
|
|
36
36
|
"http://www.imdb.com/title/tt0111161/" => "tt0111161",
|
37
37
|
"http://www.imdb.com/title/tt1352369/" => "tt1352369",
|
38
38
|
"http://www.imdb.com/title/tt0083987/" => "tt0083987",
|
39
|
-
"http://www.imdb.com/title/tt0036855/" => "tt0036855"
|
39
|
+
"http://www.imdb.com/title/tt0036855/" => "tt0036855",
|
40
|
+
"http://www.imdb.com/title/tt0110912/" => "tt0110912"
|
40
41
|
}
|
41
42
|
|
42
43
|
unless ENV['LIVE_TEST']
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imdb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 6
|
8
|
+
- 5
|
9
|
+
version: 0.6.5
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Ariejan de Vroom
|
@@ -9,49 +14,59 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-04-29 00:00:00 +02:00
|
13
18
|
default_executable: imdb
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: rspec
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
23
29
|
version: "0"
|
24
|
-
|
30
|
+
type: :development
|
31
|
+
version_requirements: *id001
|
25
32
|
- !ruby/object:Gem::Dependency
|
26
33
|
name: hpricot
|
27
|
-
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
34
|
+
prerelease: false
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - ">="
|
32
38
|
- !ruby/object:Gem::Version
|
39
|
+
segments:
|
40
|
+
- 0
|
41
|
+
- 8
|
42
|
+
- 1
|
33
43
|
version: 0.8.1
|
34
|
-
|
44
|
+
type: :runtime
|
45
|
+
version_requirements: *id002
|
35
46
|
- !ruby/object:Gem::Dependency
|
36
47
|
name: fakeweb
|
37
|
-
|
38
|
-
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
48
|
+
prerelease: false
|
49
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
50
|
requirements:
|
41
51
|
- - ">="
|
42
52
|
- !ruby/object:Gem::Version
|
53
|
+
segments:
|
54
|
+
- 0
|
43
55
|
version: "0"
|
44
|
-
|
56
|
+
type: :development
|
57
|
+
version_requirements: *id003
|
45
58
|
- !ruby/object:Gem::Dependency
|
46
59
|
name: rspec
|
47
|
-
|
48
|
-
|
49
|
-
version_requirements: !ruby/object:Gem::Requirement
|
60
|
+
prerelease: false
|
61
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
50
62
|
requirements:
|
51
63
|
- - ">="
|
52
64
|
- !ruby/object:Gem::Version
|
65
|
+
segments:
|
66
|
+
- 0
|
53
67
|
version: "0"
|
54
|
-
|
68
|
+
type: :development
|
69
|
+
version_requirements: *id004
|
55
70
|
description: Easily use Ruby or the command line to find information on IMDB.com.
|
56
71
|
email: ariejan@ariejan.net
|
57
72
|
executables:
|
@@ -87,6 +102,7 @@ files:
|
|
87
102
|
- spec/fixtures/tt0036855
|
88
103
|
- spec/fixtures/tt0083987
|
89
104
|
- spec/fixtures/tt0095016
|
105
|
+
- spec/fixtures/tt0110912
|
90
106
|
- spec/fixtures/tt0111161
|
91
107
|
- spec/fixtures/tt0117731
|
92
108
|
- spec/fixtures/tt0242653
|
@@ -114,18 +130,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
114
130
|
requirements:
|
115
131
|
- - ">="
|
116
132
|
- !ruby/object:Gem::Version
|
133
|
+
segments:
|
134
|
+
- 0
|
117
135
|
version: "0"
|
118
|
-
version:
|
119
136
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
137
|
requirements:
|
121
138
|
- - ">="
|
122
139
|
- !ruby/object:Gem::Version
|
140
|
+
segments:
|
141
|
+
- 0
|
123
142
|
version: "0"
|
124
|
-
version:
|
125
143
|
requirements: []
|
126
144
|
|
127
145
|
rubyforge_project:
|
128
|
-
rubygems_version: 1.3.
|
146
|
+
rubygems_version: 1.3.6
|
129
147
|
signing_key:
|
130
148
|
specification_version: 3
|
131
149
|
summary: Easily access the publicly available information on IMDB.
|