imdb_party 0.2.0 → 0.3.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.
- data/VERSION +1 -1
- data/imdb_party.gemspec +2 -2
- data/lib/imdb_party/httparty_icebox.rb +1 -1
- data/lib/imdb_party/imdb.rb +2 -1
- data/test/search_test.rb +14 -4
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/imdb_party.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{imdb_party}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jon Maddox"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-11-19}
|
13
13
|
s.description = %q{IMDB client using the IMDB API that their iPhone app uses}
|
14
14
|
s.email = %q{jon@mustacheinc.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/imdb_party/imdb.rb
CHANGED
@@ -14,7 +14,8 @@ module ImdbParty
|
|
14
14
|
|
15
15
|
if results["data"]["results"]
|
16
16
|
results["data"]["results"].each do |result_section|
|
17
|
-
result_section["list"].each do |r|
|
17
|
+
result_section["list"].each do |r|
|
18
|
+
next unless r["tconst"] && r["title"]
|
18
19
|
h = {:title => r["title"], :year => r["year"], :imdb_id => r["tconst"]}
|
19
20
|
h.merge!(:poster_url => r["image"]["url"]) if r["image"] && r["image"]["url"]
|
20
21
|
movie_results << h
|
data/test/search_test.rb
CHANGED
@@ -11,17 +11,27 @@ class SearchTest < Test::Unit::TestCase
|
|
11
11
|
@results = @imdb.find_by_title("ratatouille")
|
12
12
|
end
|
13
13
|
|
14
|
-
should "have 15 results" do
|
15
|
-
|
14
|
+
should "have at least 15 results" do
|
15
|
+
assert (@results.size >= 15)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
+
context "search for title with spaces in the name" do
|
20
|
+
setup do
|
21
|
+
@results = @imdb.find_by_title("the truman show")
|
22
|
+
end
|
23
|
+
|
24
|
+
should "have at least 1 result" do
|
25
|
+
assert (@results.size >= 1)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
19
29
|
context "search for bad title with no results" do
|
20
30
|
setup do
|
21
31
|
@results = @imdb.find_by_title("sdkljlkkl123j4lk23kl3")
|
22
32
|
end
|
23
33
|
|
24
|
-
should "have
|
34
|
+
should "have 0 results" do
|
25
35
|
assert_equal 0, @results.size
|
26
36
|
end
|
27
37
|
end
|
@@ -59,4 +69,4 @@ class SearchTest < Test::Unit::TestCase
|
|
59
69
|
end
|
60
70
|
|
61
71
|
end
|
62
|
-
end
|
72
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imdb_party
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 3
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jon Maddox
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-11-19 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|