spotlite 0.7.2 → 0.8.0
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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +14 -0
- data/README.md +8 -41
- data/Rakefile +23 -3
- data/lib/spotlite.rb +1 -8
- data/lib/spotlite/movie.rb +169 -80
- data/lib/spotlite/person.rb +90 -14
- data/lib/spotlite/string_extensions.rb +9 -9
- data/lib/spotlite/version.rb +1 -1
- data/spec/fixtures/movie_find_conan +722 -0
- data/spec/fixtures/{search_no_results → movie_find_no_results} +95 -149
- data/spec/fixtures/nm0000233/index +6118 -0
- data/spec/fixtures/nm0005132/index +817 -740
- data/spec/fixtures/nm0864666/index +199 -221
- data/spec/fixtures/nm1659547/index +748 -719
- data/spec/fixtures/person_find_conan +722 -0
- data/spec/fixtures/{search_the_core → person_find_no_results} +112 -219
- data/spec/fixtures/tt0002186/index +212 -242
- data/spec/fixtures/tt0047396/releaseinfo +217 -292
- data/spec/fixtures/tt0112873/index +556 -539
- data/spec/fixtures/tt0133093/criticreviews +169 -250
- data/spec/fixtures/tt0133093/fullcredits +212 -299
- data/spec/fixtures/tt0133093/index +444 -491
- data/spec/fixtures/tt0133093/keywords +416 -492
- data/spec/fixtures/tt0133093/mediaindex_still_frame +114 -158
- data/spec/fixtures/tt0133093/releaseinfo +282 -344
- data/spec/fixtures/tt0133093/technical +1144 -0
- data/spec/fixtures/tt0133093/trivia +1350 -1230
- data/spec/fixtures/tt0169547/index +629 -644
- data/spec/fixtures/tt0317248/index +579 -608
- data/spec/fixtures/tt1134629/fullcredits +257 -340
- data/spec/spec_helper.rb +24 -23
- data/spec/spotlite/find_spec.rb +38 -0
- data/spec/spotlite/movie_spec.rb +73 -57
- data/spec/spotlite/person_spec.rb +60 -1
- data/spotlite.gemspec +9 -9
- metadata +34 -56
- data/lib/spotlite/box_office_top.rb +0 -11
- data/lib/spotlite/coming_soon.rb +0 -24
- data/lib/spotlite/in_theaters.rb +0 -25
- data/lib/spotlite/list.rb +0 -18
- data/lib/spotlite/opening_this_week.rb +0 -11
- data/lib/spotlite/search.rb +0 -45
- data/lib/spotlite/top.rb +0 -23
- data/spec/fixtures/movies_coming_soon +0 -2103
- data/spec/fixtures/movies_in_theaters +0 -2708
- data/spec/fixtures/top +0 -10823
- data/spec/spotlite/box_office_top_spec.rb +0 -29
- data/spec/spotlite/coming_soon_spec.rb +0 -29
- data/spec/spotlite/opening_this_week_spec.rb +0 -29
- data/spec/spotlite/search_spec.rb +0 -34
- data/spec/spotlite/top_spec.rb +0 -21
- data/tasks/fixtures.rake +0 -15
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "Spotlite::BoxOfficeTop" do
|
4
|
-
before(:each) do
|
5
|
-
@list = Spotlite::BoxOfficeTop.new.movies
|
6
|
-
end
|
7
|
-
|
8
|
-
it "should return 10 results" do
|
9
|
-
@list.size.should eql(10)
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should return Spotlite::Movie objects" do
|
13
|
-
@list.each { |movie| movie.should be_a(Spotlite::Movie) }
|
14
|
-
end
|
15
|
-
|
16
|
-
describe "Movie" do
|
17
|
-
it "should have IMDb ID" do
|
18
|
-
@list.each { |movie| movie.imdb_id.should match(/\d{7}/) }
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should have title" do
|
22
|
-
@list.each { |movie| movie.title.should match(/\w+/) }
|
23
|
-
end
|
24
|
-
|
25
|
-
it "should have year" do
|
26
|
-
@list.each { |movie| movie.year.to_s.should match(/\d{4}/) }
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "Spotlite::ComingSoon" do
|
4
|
-
before(:each) do
|
5
|
-
@list = Spotlite::ComingSoon.new.movies
|
6
|
-
end
|
7
|
-
|
8
|
-
it "should return a few results" do
|
9
|
-
@list.size.should be_within(14).of(15)
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should return Spotlite::Movie objects" do
|
13
|
-
@list.each { |movie| movie.should be_a(Spotlite::Movie) }
|
14
|
-
end
|
15
|
-
|
16
|
-
describe "Movie" do
|
17
|
-
it "should have IMDb ID" do
|
18
|
-
@list.each { |movie| movie.imdb_id.should match(/\d{7}/) }
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should have title" do
|
22
|
-
@list.each { |movie| movie.title.should match(/\w+/) }
|
23
|
-
end
|
24
|
-
|
25
|
-
it "should have year" do
|
26
|
-
@list.each { |movie| movie.year.to_s.should match(/\d{4}/) }
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "Spotlite::OpeningThisWeek" do
|
4
|
-
before(:each) do
|
5
|
-
@list = Spotlite::OpeningThisWeek.new.movies
|
6
|
-
end
|
7
|
-
|
8
|
-
it "should return a few results" do
|
9
|
-
@list.size.should be_within(14).of(15)
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should return Spotlite::Movie objects" do
|
13
|
-
@list.each { |movie| movie.should be_a(Spotlite::Movie) }
|
14
|
-
end
|
15
|
-
|
16
|
-
describe "Movie" do
|
17
|
-
it "should have IMDb ID" do
|
18
|
-
@list.each { |movie| movie.imdb_id.should match(/\d{7}/) }
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should have title" do
|
22
|
-
@list.each { |movie| movie.title.should match(/\w+/) }
|
23
|
-
end
|
24
|
-
|
25
|
-
it "should have year" do
|
26
|
-
@list.each { |movie| movie.year.to_s.should match(/\d{4}/) }
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "Spotlite::Search" do
|
4
|
-
before(:each) do
|
5
|
-
@search = Spotlite::Search.new("the core")
|
6
|
-
end
|
7
|
-
|
8
|
-
it "should return 6 results" do
|
9
|
-
@search.movies.size.should be_within(5).of(10)
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should return Spotlite::Movie objects" do
|
13
|
-
@search.movies.each { |movie| movie.should be_a(Spotlite::Movie) }
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should return IMDb ID, title, and year" do
|
17
|
-
@search.movies.first.imdb_id.should eql("0298814")
|
18
|
-
@search.movies.first.title.should eql("The Core")
|
19
|
-
@search.movies.first.year.should eql(2003)
|
20
|
-
end
|
21
|
-
|
22
|
-
it "should not contain video games" do
|
23
|
-
@search.movies.each { |movie| movie.imdb_id.should_not eql("0483593") }
|
24
|
-
end
|
25
|
-
|
26
|
-
it "should not contain TV series/episodes" do
|
27
|
-
@search.movies.each { |movie| movie.imdb_id.should_not eql("1979599") }
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should handle 'No results found'" do
|
31
|
-
@search = Spotlite::Search.new("wappadoozle swambling")
|
32
|
-
@search.movies.should be_empty
|
33
|
-
end
|
34
|
-
end
|
data/spec/spotlite/top_spec.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "Spotlite::Top" do
|
4
|
-
before(:each) do
|
5
|
-
@top = Spotlite::Top.new.movies
|
6
|
-
end
|
7
|
-
|
8
|
-
it "should return 250 results" do
|
9
|
-
@top.size.should eql(250)
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should return Spotlite::Movie objects" do
|
13
|
-
@top.each { |movie| movie.should be_a(Spotlite::Movie) }
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should return IMDb ID and title" do
|
17
|
-
@top.first.imdb_id.should eql("0111161")
|
18
|
-
@top.first.title.should eql("The Shawshank Redemption")
|
19
|
-
@top.first.year.should eql(1994)
|
20
|
-
end
|
21
|
-
end
|
data/tasks/fixtures.rake
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
namespace :fixtures do
|
2
|
-
desc "Refresh spec fixtures with fresh data from IMDb.com"
|
3
|
-
task :refresh do
|
4
|
-
require File.expand_path(File.dirname(__FILE__) + "/../spec/spec_helper")
|
5
|
-
|
6
|
-
IMDB_SAMPLES.each_pair do |url, fixture|
|
7
|
-
page = `curl -isH "Accept-Language: en-us" #{url}`
|
8
|
-
|
9
|
-
File.open(File.expand_path(File.dirname(__FILE__) + "/../spec/fixtures/#{fixture}"), 'w') do |f|
|
10
|
-
f.write(page)
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|