google-book 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@ module Google
6
6
  end
7
7
 
8
8
  def to_books
9
- @feed['entry'].map do |hash|
9
+ [@feed['entry']].flatten.map do |hash|
10
10
  book = Struct.new(
11
11
  Cover.new(hash['link'][0]['href']),
12
12
  hash['link'][1]['href'],
@@ -1,5 +1,5 @@
1
1
  module Google
2
2
  module Book
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
  end
@@ -15,7 +15,11 @@ module Google
15
15
 
16
16
  it "should return books" do
17
17
  books = response.to_books
18
- books.first.should be_an_instance_of Struct
18
+ books.first.should be_a Struct
19
+ end
20
+
21
+ it "should handle single matches" do
22
+ Request.find('9780826490780').to_books.first.should be_a Struct
19
23
  end
20
24
  end
21
25
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: google-book
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.0
5
+ version: 0.2.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Paper Cavalier