entrez 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -72,6 +72,8 @@ class Entrez
72
72
  response.instance_eval do
73
73
  def ids
74
74
  @ids ||= self['eSearchResult']['IdList']['Id'].map(&:to_i)
75
+ rescue ::NoMethodError
76
+ @ids = []
75
77
  end
76
78
  end
77
79
  end
@@ -1,3 +1,3 @@
1
1
  module Entrez
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
@@ -32,6 +32,11 @@ describe Entrez do
32
32
  response.ids.should == [60153, 29429, 28911, 48101, 59851, 59849, 59847, 59845, 59839, 59835, 59833, 59831, 51895, 59829, 59827, 60835, 59811, 60831, 60819, 33895]
33
33
  end
34
34
 
35
+ it 'ESearch returns empty array if nothing found' do
36
+ response = Entrez.ESearch('genomeprj', {NON_EXISTENT_SEARCH_FIELD: 'does not exist even in oompaloompa land'}, retmode: :xml)
37
+ response.ids.should be_empty
38
+ end
39
+
35
40
  it 'should respect query limit' do
36
41
  requests = proc { 4.times { Entrez.EFetch('taxonomy', id: 9606) } }
37
42
  requests.should take_longer_than(1.0)
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: entrez
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.5.1
5
+ version: 0.5.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jared Ning