impawards 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{impawards}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
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{2009-10-30}
12
+ s.date = %q{2009-11-03}
13
13
  s.description = %q{Simple library to find high quality posters for movies}
14
14
  s.email = %q{jon@mustacheinc.com}
15
15
  s.extra_rdoc_files = [
@@ -19,7 +19,7 @@ module IMPAwards
19
19
 
20
20
  def self.get_posters(query)
21
21
  movie_urls = get_movie_results(query)
22
- movie_urls.delete_if{|movie_url| movie_url.inner_text !~ /#{query}/i}
22
+ movie_urls.delete_if{|movie_url| movie_url.inner_text !~ /^#{query} Poster -/i}
23
23
  if movie_urls.size > 0
24
24
  posters_for_url(movie_urls.first['href'])
25
25
  else
@@ -93,6 +93,21 @@ class ImpawardsTest < Test::Unit::TestCase
93
93
  end
94
94
 
95
95
  end
96
+
97
+ context "with results that kinda match the query" do
98
+ setup do
99
+ @results = IMPAwards::IMPAwards.get_posters("warrior")
100
+ end
101
+
102
+ should "return an array" do
103
+ assert_equal Array, @results.class
104
+ end
105
+
106
+ should "return an empty array" do
107
+ assert @results.empty?
108
+ end
109
+
110
+ end
96
111
 
97
112
 
98
113
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: impawards
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Maddox
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-30 00:00:00 -04:00
12
+ date: 2009-11-03 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency