royw-imdb 0.1.5 → 0.1.6

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.
data/Rakefile CHANGED
@@ -8,6 +8,7 @@ task :default => :spec
8
8
  Spec::Rake::SpecTask.new(:spec) do |spec|
9
9
  spec.libs << 'lib' << 'spec'
10
10
  spec.spec_files = FileList['spec/**/*_spec.rb']
11
+ spec.spec_opts = ["--color", "--format nested"]
11
12
  end
12
13
 
13
14
  Spec::Rake::SpecTask.new('spec:html') do |spec|
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 1
3
- :patch: 5
3
+ :patch: 6
4
4
  :major: 0
@@ -10,7 +10,6 @@ describe ImdbMovie do
10
10
  end
11
11
 
12
12
  it "should query IMDB url" do
13
- # @imdb_movie.should_receive(:open).with("http://www.imdb.com/title/tt0050562/").and_return(open("#{$samples_dir}/sample_jet_pilot.html"))
14
13
  @imdb_movie.should_receive(:fetch).with("http://www.imdb.com/title/tt0050562/").and_return(open("#{$samples_dir}/www.imdb.com/title/tt0050562.html"))
15
14
  @imdb_movie.send(:document)
16
15
  end
@@ -31,14 +30,8 @@ describe ImdbMovie do
31
30
 
32
31
  before(:each) do
33
32
  @imdb_movie = ImdbMovie.new('0097576')
34
- # @imdb_movie.stub!(:open).and_return(open("#{$samples_dir}/sample_movie.html"))
35
33
  end
36
34
 
37
- # it "should query IMDB url" do
38
- # @imdb_movie.should_receive(:open).with("http://www.imdb.com/title/tt0097576/").and_return(open("#{$samples_dir}/www.imdb.com/title/tt0097576.html"))
39
- # @imdb_movie.send(:document)
40
- # end
41
-
42
35
  it "should get the title" do
43
36
  @imdb_movie.title.should == "Indiana Jones and the Last Crusade"
44
37
  end
@@ -157,15 +150,8 @@ describe ImdbMovie do
157
150
 
158
151
  before(:each) do
159
152
  @imdb_movie = ImdbMovie.new('0054961')
160
- # @imdb_movie.stub!(:open).and_return(open("#{$samples_dir}/sample_incomplete_movie.html"))
161
153
  end
162
154
 
163
- # it "should query IMDB url" do
164
- # @imdb_movie.should_receive(:open).with("http://www.imdb.com/title/tt0054961/").and_return(open("#{$samples_dir}/sample_incomplete_movie.html"))
165
- # @imdb_movie.should_receive(:open).with("http://www.imdb.com/title/tt0054961/").and_return(open("#{$samples_dir}/www.imdb.com/title/tt0054961.html"))
166
- # @imdb_movie.send(:document)
167
- # end
168
-
169
155
  it "should get the title" do
170
156
  @imdb_movie.title.should == "Han robado una estrella"
171
157
  end
@@ -17,205 +17,211 @@ describe "ImdbProfile" do
17
17
  Dir.glob(File.join(TMPDIR, "imdb_profile_spec*")).each { |filename| File.delete(filename) }
18
18
  end
19
19
 
20
- it "should find by imdb_id that is prefixed with a 'tt'" do
21
- profile = ImdbProfile.first(:imdb_id => 'tt0465234')
22
- profile.should_not == nil
23
- end
20
+ describe "Simple finds using ImdbProfile.first" do
21
+ it "should find by imdb_id that is prefixed with a 'tt'" do
22
+ profile = ImdbProfile.first(:imdb_id => 'tt0465234')
23
+ profile.should_not == nil
24
+ end
24
25
 
25
- it "should find by imdb_id that is not prefixed with 'tt'" do
26
- profile = ImdbProfile.first(:imdb_id => '0465234')
27
- profile.should_not == nil
28
- end
26
+ it "should find by imdb_id that is not prefixed with 'tt'" do
27
+ profile = ImdbProfile.first(:imdb_id => '0465234')
28
+ profile.should_not == nil
29
+ end
29
30
 
30
- it "should find by single title" do
31
- profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'])
32
- profile.should_not == nil
33
- end
31
+ it "should find by single title" do
32
+ profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'])
33
+ profile.should_not == nil
34
+ end
34
35
 
35
- it "should find by multiple title" do
36
- profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets', 'National Treasure 2'])
37
- profile.should_not == nil
38
- end
36
+ it "should find by multiple title" do
37
+ profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets', 'National Treasure 2'])
38
+ profile.should_not == nil
39
+ end
39
40
 
40
- it "should find by multiple title embedded in arrays" do
41
- profile = ImdbProfile.first(:titles => [['National Treasure: Book of Secrets'], 'National Treasure 2'])
42
- profile.should_not == nil
43
- end
41
+ it "should find by multiple title embedded in arrays" do
42
+ profile = ImdbProfile.first(:titles => [['National Treasure: Book of Secrets'], 'National Treasure 2'])
43
+ profile.should_not == nil
44
+ end
44
45
 
45
- it "should find by AKA title" do
46
- profile = ImdbProfile.first(:titles => ['National Treasure 2'])
47
- profile.should_not == nil
46
+ it "should find by AKA title" do
47
+ profile = ImdbProfile.first(:titles => ['National Treasure 2'])
48
+ profile.should_not == nil
49
+ end
48
50
  end
49
51
 
50
- # We use two versions of "The Alamo" to test for year discrimination
51
- # John Wayne's The Alamo produced and released in 1960, IMDB ID => tt0053580
52
- # John Lee Hancock's The Alamo produced and released in 2004, IMDB ID => tt0318974
52
+ describe "multiple finds using ImdbProfile.all" do
53
+ # We use two versions of "The Alamo" to test for year discrimination
54
+ # John Wayne's The Alamo produced and released in 1960, IMDB ID => tt0053580
55
+ # John Lee Hancock's The Alamo produced and released in 2004, IMDB ID => tt0318974
53
56
 
54
- # test all()
55
- it "should find multiple versions of The Alamo" do
56
- profiles = ImdbProfile.all(:titles => ['The Alamo'])
57
- profiles.length.should > 1
58
- end
57
+ # test all()
58
+ it "should find multiple versions of The Alamo" do
59
+ profiles = ImdbProfile.all(:titles => ['The Alamo'])
60
+ profiles.length.should > 1
61
+ end
59
62
 
60
- it "should find the two versions of The Alamo that we are interested in" do
61
- profiles = ImdbProfile.all(:titles => ['The Alamo'])
62
- imdb_ids = profiles.collect{|profile| profile.imdb_id}
63
- imdb_ids = imdb_ids.select{|ident| ident == 'tt0053580' || ident == 'tt0318974'}
64
- imdb_ids.uniq.compact.length.should == 2
63
+ it "should find the two versions of The Alamo that we are interested in" do
64
+ profiles = ImdbProfile.all(:titles => ['The Alamo'])
65
+ imdb_ids = profiles.collect{|profile| profile.imdb_id}
66
+ imdb_ids = imdb_ids.select{|ident| ident == 'tt0053580' || ident == 'tt0318974'}
67
+ imdb_ids.uniq.compact.length.should == 2
68
+ end
65
69
  end
66
70
 
67
- # find first using title and media year
68
-
69
- it "should find John Wayne's The Alamo by title with media year" do
70
- profile = ImdbProfile.first(:titles => ['The Alamo'], :media_years => [1960])
71
- profile.imdb_id.should == 'tt0053580'
72
- end
71
+ describe "find first using title and media year" do
72
+ it "should find John Wayne's The Alamo by title with media year" do
73
+ profile = ImdbProfile.first(:titles => ['The Alamo'], :media_years => [1960])
74
+ profile.imdb_id.should == 'tt0053580'
75
+ end
73
76
 
74
- it "should find John Lee Hancock's The Alamo by title with media year" do
75
- profile = ImdbProfile.first(:titles => ['The Alamo'], :media_years => [2004])
76
- profile.imdb_id.should == 'tt0318974'
77
+ it "should find John Lee Hancock's The Alamo by title with media year" do
78
+ profile = ImdbProfile.first(:titles => ['The Alamo'], :media_years => [2004])
79
+ profile.imdb_id.should == 'tt0318974'
80
+ end
77
81
  end
78
82
 
79
- # find first using title and production year
80
-
81
- it "should find John Wayne's The Alamo by title with production year" do
82
- profile = ImdbProfile.first(:titles => ['The Alamo'], :production_years => [1960])
83
- profile.imdb_id.should == 'tt0053580'
84
- end
83
+ describe "find first using title and production year" do
84
+ it "should find John Wayne's The Alamo by title with production year" do
85
+ profile = ImdbProfile.first(:titles => ['The Alamo'], :production_years => [1960])
86
+ profile.imdb_id.should == 'tt0053580'
87
+ end
85
88
 
86
- it "should find John Lee Hancock's The Alamo by title with production year" do
87
- profile = ImdbProfile.first(:titles => ['The Alamo'], :production_years => [2004])
88
- profile.imdb_id.should == 'tt0318974'
89
+ it "should find John Lee Hancock's The Alamo by title with production year" do
90
+ profile = ImdbProfile.first(:titles => ['The Alamo'], :production_years => [2004])
91
+ profile.imdb_id.should == 'tt0318974'
92
+ end
89
93
  end
90
94
 
91
- # find first using title and released year
92
-
93
- it "should find John Wayne's The Alamo by title with released year" do
94
- profile = ImdbProfile.first(:titles => ['The Alamo'], :released_years => [1960])
95
- profile.imdb_id.should == 'tt0053580'
96
- end
95
+ describe "find first using title and released year" do
96
+ it "should find John Wayne's The Alamo by title with released year" do
97
+ profile = ImdbProfile.first(:titles => ['The Alamo'], :released_years => [1960])
98
+ profile.imdb_id.should == 'tt0053580'
99
+ end
97
100
 
98
- it "should find John Lee Hancock's The Alamo by title with released year" do
99
- profile = ImdbProfile.first(:titles => ['The Alamo'], :released_years => [2004])
100
- profile.imdb_id.should == 'tt0318974'
101
+ it "should find John Lee Hancock's The Alamo by title with released year" do
102
+ profile = ImdbProfile.first(:titles => ['The Alamo'], :released_years => [2004])
103
+ profile.imdb_id.should == 'tt0318974'
104
+ end
101
105
  end
102
106
 
103
- # here we test fuzzy year matching (plus or minus a year)
104
- # fuzzy years are only supported for production and released years, not media years
105
-
106
- it "should not find John Wayne's The Alamo by title with the media year off by a year" do
107
- profile1 = ImdbProfile.first(:titles => ['The Alamo'], :media_years => [1959])
108
- profile2 = ImdbProfile.first(:titles => ['The Alamo'], :media_years => [1961])
109
- (profile1.should be_nil) && (profile2.should be_nil)
110
- end
107
+ describe "fuzzy year matching (plus or minus a year)" do
108
+ # fuzzy years are only supported for production and released years, not media years
109
+ it "should not find John Wayne's The Alamo by title with the media year off by a year" do
110
+ profile1 = ImdbProfile.first(:titles => ['The Alamo'], :media_years => [1959])
111
+ profile2 = ImdbProfile.first(:titles => ['The Alamo'], :media_years => [1961])
112
+ (profile1.should be_nil) && (profile2.should be_nil)
113
+ end
111
114
 
112
- it "should find John Wayne's The Alamo by title with the production year off by a year" do
113
- profile1 = ImdbProfile.first(:titles => ['The Alamo'], :production_years => [1959])
114
- profile2 = ImdbProfile.first(:titles => ['The Alamo'], :production_years => [1961])
115
- (profile1.imdb_id.should == 'tt0053580') && (profile2.imdb_id.should == 'tt0053580')
116
- end
115
+ it "should find John Wayne's The Alamo by title with the production year off by a year" do
116
+ profile1 = ImdbProfile.first(:titles => ['The Alamo'], :production_years => [1959])
117
+ profile2 = ImdbProfile.first(:titles => ['The Alamo'], :production_years => [1961])
118
+ (profile1.imdb_id.should == 'tt0053580') && (profile2.imdb_id.should == 'tt0053580')
119
+ end
117
120
 
118
- it "should find John Wayne's The Alamo by title with the released year off by a year" do
119
- profile1 = ImdbProfile.first(:titles => ['The Alamo'], :released_years => [1959])
120
- profile2 = ImdbProfile.first(:titles => ['The Alamo'], :released_years => [1961])
121
- (profile1.imdb_id.should == 'tt0053580') && (profile2.imdb_id.should == 'tt0053580')
122
- end
121
+ it "should find John Wayne's The Alamo by title with the released year off by a year" do
122
+ profile1 = ImdbProfile.first(:titles => ['The Alamo'], :released_years => [1959])
123
+ profile2 = ImdbProfile.first(:titles => ['The Alamo'], :released_years => [1961])
124
+ (profile1.imdb_id.should == 'tt0053580') && (profile2.imdb_id.should == 'tt0053580')
125
+ end
123
126
 
124
- it "should not find John Wayne's The Alamo by title with the production year off by two years" do
125
- profile1 = ImdbProfile.first(:titles => ['The Alamo'], :production_years => [1958])
126
- profile2 = ImdbProfile.first(:titles => ['The Alamo'], :production_years => [1962])
127
- (profile1.should be_nil) && (profile2.should be_nil)
128
- end
127
+ it "should not find John Wayne's The Alamo by title with the production year off by two years" do
128
+ profile1 = ImdbProfile.first(:titles => ['The Alamo'], :production_years => [1958])
129
+ profile2 = ImdbProfile.first(:titles => ['The Alamo'], :production_years => [1962])
130
+ (profile1.should be_nil) && (profile2.should be_nil)
131
+ end
129
132
 
130
- it "should not find John Wayne's The Alamo by title with the released year off by two years" do
131
- profile1 = ImdbProfile.first(:titles => ['The Alamo'], :released_years => [1958])
132
- profile2 = ImdbProfile.first(:titles => ['The Alamo'], :released_years => [1962])
133
- (profile1.should be_nil) && (profile2.should be_nil)
133
+ it "should not find John Wayne's The Alamo by title with the released year off by two years" do
134
+ profile1 = ImdbProfile.first(:titles => ['The Alamo'], :released_years => [1958])
135
+ profile2 = ImdbProfile.first(:titles => ['The Alamo'], :released_years => [1962])
136
+ (profile1.should be_nil) && (profile2.should be_nil)
137
+ end
134
138
  end
135
139
 
136
- # let's make sure the generated xml from to_xml() is valid
137
-
138
- it "should be able to convert to xml and then from xml" do
139
- hash = nil
140
- begin
141
- profile = ImdbProfile.first(:imdb_id => 'tt0465234')
142
- xml = profile.to_xml
143
- hash = XmlSimple.xml_in(xml)
144
- rescue
140
+ describe "let's make sure the generated xml from to_xml() is valid" do
141
+ it "should be able to convert to xml and then from xml" do
145
142
  hash = nil
143
+ begin
144
+ profile = ImdbProfile.first(:imdb_id => 'tt0465234')
145
+ xml = profile.to_xml
146
+ hash = XmlSimple.xml_in(xml)
147
+ rescue
148
+ hash = nil
149
+ end
150
+ hash.should_not be_nil
146
151
  end
147
- hash.should_not be_nil
148
152
  end
149
153
 
150
- # now let's test caching the profile to/from a file
151
-
152
- it "should not create a file if a :filespec option is passed that is nil" do
153
- profile = ImdbProfile.first(:titles => ['The Alamo'], :released_years => [1960], :filespec => nil)
154
- Dir.glob(File.join(TMPDIR, "imdb_profile_spec*")).empty?.should be_true
155
- end
154
+ describe "test caching the profile to/from a file" do
155
+ it "should not create a file if a :filespec option is passed that is nil" do
156
+ profile = ImdbProfile.first(:titles => ['The Alamo'], :released_years => [1960], :filespec => nil)
157
+ Dir.glob(File.join(TMPDIR, "imdb_profile_spec*")).empty?.should be_true
158
+ end
156
159
 
157
- it "should create a file if a :filespec option is passed" do
158
- filespec = get_temp_filename
159
- profile = ImdbProfile.first(:titles => ['The Alamo'], :released_years => [1960], :filespec => filespec)
160
- (File.exist?(filespec) && (File.size(filespec) > 0)).should be_true
161
- end
160
+ it "should create a file if a :filespec option is passed" do
161
+ filespec = get_temp_filename
162
+ profile = ImdbProfile.first(:titles => ['The Alamo'], :released_years => [1960], :filespec => filespec)
163
+ (File.exist?(filespec) && (File.size(filespec) > 0)).should be_true
164
+ end
162
165
 
163
- it "should load from a file if a :filespec option is passed and the file exists" do
164
- filespec = get_temp_filename
165
- profile1 = ImdbProfile.first(:titles => ['The Alamo'], :released_years => [1960], :filespec => filespec)
166
- profile2 = ImdbProfile.first(:filespec => filespec)
167
- profile1.imdb_id.should == profile2.imdb_id
168
- end
166
+ it "should load from a file if a :filespec option is passed and the file exists" do
167
+ filespec = get_temp_filename
168
+ profile1 = ImdbProfile.first(:titles => ['The Alamo'], :released_years => [1960], :filespec => filespec)
169
+ profile2 = ImdbProfile.first(:filespec => filespec)
170
+ profile1.imdb_id.should == profile2.imdb_id
171
+ end
169
172
 
170
- it "should not load from a file if a :filespec option is passed and the file does not exists" do
171
- filespec = get_temp_filename
172
- profile = ImdbProfile.first(:filespec => filespec)
173
- profile.should be_nil
173
+ it "should not load from a file if a :filespec option is passed and the file does not exists" do
174
+ filespec = get_temp_filename
175
+ profile = ImdbProfile.first(:filespec => filespec)
176
+ profile.should be_nil
177
+ end
174
178
  end
175
179
 
176
- it "should handle media year == nil" do
177
- profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :media_years => [nil])
178
- profile.should_not == nil
179
- end
180
+ describe "When years are invalid (nil, 0, or '0')" do
181
+ it "should handle media year == nil" do
182
+ profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :media_years => [nil])
183
+ profile.should_not == nil
184
+ end
180
185
 
181
- it "should handle media year == 0" do
182
- profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :media_years => [0])
183
- profile.should_not == nil
184
- end
186
+ it "should handle media year == 0" do
187
+ profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :media_years => [0])
188
+ profile.should_not == nil
189
+ end
185
190
 
186
- it "should handle media year == '0'" do
187
- profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :media_years => ['0'])
188
- profile.should_not == nil
189
- end
191
+ it "should handle media year == '0'" do
192
+ profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :media_years => ['0'])
193
+ profile.should_not == nil
194
+ end
190
195
 
191
- it "should handle production year == nil" do
192
- profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :production_years => [nil])
193
- profile.should_not == nil
194
- end
196
+ it "should handle production year == nil" do
197
+ profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :production_years => [nil])
198
+ profile.should_not == nil
199
+ end
195
200
 
196
- it "should handle media production == 0" do
197
- profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :production_years => [0])
198
- profile.should_not == nil
199
- end
201
+ it "should handle media production == 0" do
202
+ profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :production_years => [0])
203
+ profile.should_not == nil
204
+ end
200
205
 
201
- it "should handle production year == '0'" do
202
- profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :production_years => ['0'])
203
- profile.should_not == nil
204
- end
206
+ it "should handle production year == '0'" do
207
+ profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :production_years => ['0'])
208
+ profile.should_not == nil
209
+ end
205
210
 
206
- it "should handle released year == nil" do
207
- profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :released_years => [nil])
208
- profile.should_not == nil
209
- end
211
+ it "should handle released year == nil" do
212
+ profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :released_years => [nil])
213
+ profile.should_not == nil
214
+ end
210
215
 
211
- it "should handle released year == 0" do
212
- profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :released_years => [0])
213
- profile.should_not == nil
214
- end
216
+ it "should handle released year == 0" do
217
+ profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :released_years => [0])
218
+ profile.should_not == nil
219
+ end
215
220
 
216
- it "should handle released year == '0'" do
217
- profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :released_years => ['0'])
218
- profile.should_not == nil
221
+ it "should handle released year == '0'" do
222
+ profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :released_years => ['0'])
223
+ profile.should_not == nil
224
+ end
219
225
  end
220
226
 
221
227
  def get_temp_filename
@@ -6,15 +6,8 @@ describe ImdbSearch do
6
6
 
7
7
  before(:each) do
8
8
  @imdb_search = ImdbSearch.new('indiana jones')
9
- # @imdb_search.stub!(:open).and_return(open("#{$samples_dir}/sample_search.html"))
10
- # ImdbMovie.stub!(:use_html_cache).and_return(true)
11
9
  end
12
10
 
13
- # it "should query IMDB url" do
14
- # @imdb_search.should_receive(:open).with("http://www.imdb.com/find?q=indiana+jones;s=tt").and_return(open("#{$samples_dir}/sample_search.html"))
15
- # @imdb_search.send(:document)
16
- # end
17
-
18
11
  describe "movies" do
19
12
 
20
13
  it "should be a collection of ImdbMovie instances" do
@@ -71,24 +64,6 @@ describe ImdbSearch do
71
64
 
72
65
  end
73
66
 
74
- describe 'searches with potential encoding issues' do
75
-
76
- before(:each) do
77
- @imdb_search = ImdbSearch.new('torrente')
78
- @imdb_search.stub!(:open).and_return(open("#{$samples_dir}/sample_spanish_search.html"))
79
- ImdbMovie.stub!(:use_html_cache).and_return(true)
80
- end
81
-
82
- describe "movies" do
83
-
84
- # it "should include 'Misión en Marbella'" do
85
- # @imdb_search.movies.map { |m| m.title }.should include('Misión en Marbella')
86
- # end
87
-
88
- end
89
-
90
- end
91
-
92
67
  describe 'searches that match on AKA title' do
93
68
 
94
69
  before(:each) do
@@ -115,23 +90,24 @@ describe ImdbSearch do
115
90
 
116
91
  end
117
92
 
118
- # this is the failure test for AKA matching
119
- describe 'searches that match on AKA title but without search_aka enabled' do
120
- before(:each) do
121
- @imdb_search = ImdbSearch.new('Who Am I?', false)
122
- @imdb_search.stub!(:open).and_return(open("#{$samples_dir}/sample_who_am_i_search.html"))
123
- ImdbMovie.stub!(:use_html_cache).and_return(true)
124
- end
93
+ describe "failure test for AKA matching" do
94
+ describe 'searches that match on AKA title but without search_aka enabled' do
95
+ before(:each) do
96
+ @imdb_search = ImdbSearch.new('Who Am I?', false)
97
+ @imdb_search.stub!(:open).and_return(open("#{$samples_dir}/sample_who_am_i_search.html"))
98
+ ImdbMovie.stub!(:use_html_cache).and_return(true)
99
+ end
125
100
 
126
- describe "movies" do
101
+ describe "movies" do
127
102
 
128
- it "should have multiple movies" do
129
- @imdb_search.movies.size.should > 1
130
- end
103
+ it "should have multiple movies" do
104
+ @imdb_search.movies.size.should > 1
105
+ end
131
106
 
132
- it "should have no movies from 1998 because title is an aka" do
133
- films = @imdb_search.movies.select{|m| m.year.to_i == 1998}
134
- films.length.should == 0
107
+ it "should have no movies from 1998 because title is an aka" do
108
+ films = @imdb_search.movies.select{|m| m.year.to_i == 1998}
109
+ films.length.should == 0
110
+ end
135
111
  end
136
112
  end
137
113
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: royw-imdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roy Wright
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-22 00:00:00 -07:00
12
+ date: 2009-04-24 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -73,7 +73,6 @@ files:
73
73
  - spec/samples/www.imdb.com/find?q=some+extremely+specific+search+for+indiana+jones;s=tt
74
74
  - spec/samples/www.imdb.com/rg/action-box-title/primary-photo/media/rm1203608832/tt0097576
75
75
  - spec/spec_helper.rb
76
- - spec/string_extensions_spec.rb
77
76
  - README
78
77
  has_rdoc: true
79
78
  homepage: http://github.com/royw/imdb
@@ -106,5 +105,4 @@ test_files:
106
105
  - spec/spec_helper.rb
107
106
  - spec/imdb_search_spec.rb
108
107
  - spec/imdb_image_spec.rb
109
- - spec/string_extensions_spec.rb
110
108
  - spec/imdb_profile_spec.rb
@@ -1,25 +0,0 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
2
-
3
- describe String do
4
-
5
- describe "unescape_html" do
6
-
7
- it "should convert &amp; to &" do
8
- "M&amp;M".unescape_html.should == 'M&M'
9
- end
10
-
11
- it "should convert &#243; to ó" do
12
- "&#243;smosis".unescape_html.should == 'ósmosis'
13
- end
14
-
15
- end
16
-
17
- describe "strip_tags" do
18
-
19
- it "should strip HTML tags" do
20
- "<em>Hola</em> hola".strip_tags.should == 'Hola hola'
21
- end
22
-
23
- end
24
-
25
- end