entrez 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/entrez.rb +1 -0
- data/lib/entrez/version.rb +1 -1
- data/spec/entrez_spec.rb +30 -21
- metadata +2 -2
data/lib/entrez.rb
CHANGED
data/lib/entrez/version.rb
CHANGED
data/spec/entrez_spec.rb
CHANGED
@@ -17,35 +17,44 @@ describe Entrez do
|
|
17
17
|
response.body.should include('Hapmap')
|
18
18
|
end
|
19
19
|
|
20
|
-
it '#ESearch retrieves results' do
|
21
|
-
response = Entrez.ESearch('genomeprj', {WORD: 'hapmap', SEQS: 'inprogress'}, retmode: :xml)
|
22
|
-
response.body.should include('28911')
|
23
|
-
end
|
24
|
-
|
25
20
|
it '#EInfo retrieves results' do
|
26
21
|
response = Entrez.EInfo('snp', retmode: :xml)
|
27
22
|
response.body.should include('<Name>RS</Name>')
|
28
23
|
end
|
29
24
|
|
30
|
-
|
31
|
-
response = Entrez.ESearch('genomeprj', {WORD: 'hapmap', SEQS: 'inprogress'}, retmode: :xml)
|
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
|
-
end
|
25
|
+
context '#ESearch' do
|
34
26
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
27
|
+
it 'retrieves results' do
|
28
|
+
response = Entrez.ESearch('genomeprj', {WORD: 'hapmap', SEQS: 'inprogress'}, retmode: :xml)
|
29
|
+
response.body.should include('28911')
|
30
|
+
end
|
39
31
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
32
|
+
it 'response returns IDs for convenience' do
|
33
|
+
response = Entrez.ESearch('genomeprj', {WORD: 'hapmap', SEQS: 'inprogress'}, retmode: :xml)
|
34
|
+
response.ids.should == [60153, 29429, 28911, 48101, 59851, 59849, 59847, 59845, 59839, 59835, 59833, 59831, 51895, 59829, 59827, 60835, 59811, 60831, 60819, 33895]
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'returns empty array if nothing found' do
|
38
|
+
response = Entrez.ESearch('genomeprj', {NON_EXISTENT_SEARCH_FIELD: 'does not exist even in oompaloompa land'}, retmode: :xml)
|
39
|
+
response.ids.should be_empty
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'returns array even if only 1 id found' do
|
43
|
+
id = 60153
|
44
|
+
response = Entrez.ESearch('genomeprj', {uid: id}, retmode: :xml)
|
45
|
+
response.ids.should == [id]
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'accepts string as search_terms parameter' do
|
49
|
+
response = Entrez.ESearch('genomeprj', 'hapmap[WORD]', retmode: :xml)
|
50
|
+
response.ids.should include(60153)
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'can handle array of uids' do
|
54
|
+
response = Entrez.ESearch('gene', {UID: [1, 2, 3]})
|
55
|
+
response.ids.should =~ [1, 2, 3]
|
56
|
+
end
|
45
57
|
|
46
|
-
it '#ESearch accepts string as search_terms parameter' do
|
47
|
-
response = Entrez.ESearch('genomeprj', 'hapmap[WORD]', retmode: :xml)
|
48
|
-
response.ids.should include(60153)
|
49
58
|
end
|
50
59
|
|
51
60
|
it 'should respect query limit' do
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: entrez
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.5.
|
5
|
+
version: 0.5.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jared Ning
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-05-
|
13
|
+
date: 2011-05-31 00:00:00 -05:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|