biodiversity19 3.1.4 → 3.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Biodiversity
2
- VERSION = '3.1.4'
2
+ VERSION = '3.1.5'
3
3
  end
@@ -1,9 +1,13 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Biodiversity do
4
- it 'should have version' do
5
- version = Biodiversity::VERSION
6
- version.should =~ /^\d+\.\d+\.\d+/
7
- version.should == Biodiversity.version
4
+ describe '.version' do
5
+ it 'returns version' do
6
+ expect(subject.version).to match /^\d+\.\d+\.\d+/
7
+ end
8
+
9
+ it 'is the same as Biodiversity::Version constant' do
10
+ expect(subject.version).to eq Biodiversity::VERSION
11
+ end
8
12
  end
9
13
  end
File without changes
File without changes
@@ -1,9 +1,17 @@
1
1
  require_relative '../spec_helper'
2
2
 
3
3
  describe LsidResolver do
4
- it 'should return RFD document from lsid' do
5
- lsid = 'urn:lsid:ubio.org:classificationbank:2232671'
6
- stub(LsidResolver).resolve(lsid) {''}
7
- LsidResolver.resolve(lsid).class.should == String
4
+ describe '.resolve' do
5
+ let(:lsid) { 'urn:lsid:ubio.org:classificationbank:2232671' }
6
+
7
+ it 'resolves lsid using tdwg service' do
8
+ stub_request(:get,
9
+ %r|#{Biodiversity::LSID_RESOLVER_URL + lsid}|).to_return do
10
+ { body: File.read(File.expand_path('../../files/lsid.xml', __FILE__)) }
11
+ end
12
+ expect(LsidResolver.resolve lsid).
13
+ to match %r|<dc:title>Pternistis Wagler 1832</dc:title>|
14
+ end
8
15
  end
16
+
9
17
  end
@@ -6,7 +6,7 @@ describe ScientificNameCanonical do
6
6
  set_parser(ScientificNameCanonicalParser.new)
7
7
  end
8
8
 
9
- it 'should parse names with valid name part and unparseable rest' do
9
+ it 'parses names with valid name part and unparseable rest' do
10
10
  [
11
11
  ['Morea ssjjlajajaj324$33 234243242','Morea',
12
12
  [{:uninomial=>{:string=>"Morea"}}], {0=>["uninomial", 5]}],
@@ -26,11 +26,11 @@ describe ScientificNameCanonical do
26
26
  [{:genus=>{:string=>"Verpericola"}, :species=>{:string=>"megasoma"}}],
27
27
  {0=>["genus", 11], 12=>["species", 20]}]
28
28
  ].each do |n|
29
- parse(n[0]).should_not be_nil
30
- value(n[0]).should == n[1]
31
- details(n[0]).should == n[2]
32
- pos(n[0]).should == n[3]
33
- parse(n[0]).hybrid.should be_false
29
+ expect(parse(n[0])).not_to be_nil
30
+ expect(value(n[0])).to eq n[1]
31
+ expect(details(n[0])).to eq n[2]
32
+ expect(pos(n[0])).to eq n[3]
33
+ expect(parse(n[0]).hybrid).to be false
34
34
  end
35
35
  end
36
36
 
@@ -7,41 +7,41 @@ describe ScientificNameClean do
7
7
  set_parser(ScientificNameCleanParser.new)
8
8
  end
9
9
 
10
- it 'should parse uninomial' do
10
+ it 'parses uninomial' do
11
11
  sn = 'Pseudocercospora'
12
- parse(sn).should_not be_nil
13
- value(sn).should == 'Pseudocercospora'
14
- canonical(sn).should == 'Pseudocercospora'
15
- details(sn).should == [{:uninomial=>{:string=>"Pseudocercospora"}}]
16
- pos(sn).should == {0=>["uninomial", 16]}
17
- end
18
-
19
- it 'should parse uninomial with author and year' do
12
+ expect(parse(sn)).to_not be_nil
13
+ expect(value(sn)).to eq 'Pseudocercospora'
14
+ expect(canonical(sn)).to eq 'Pseudocercospora'
15
+ expect(details(sn)).to eq [{:uninomial=>{:string=>"Pseudocercospora"}}]
16
+ expect(pos(sn)).to eq({ 0=>["uninomial", 16] })
17
+ end
18
+
19
+ it 'parses uninomial with author and year' do
20
20
  sn = 'Pseudocercospora Speg.'
21
- parse(sn).should_not be_nil
22
- details(sn).should == [{:uninomial=>
21
+ expect(parse(sn)).to_not be_nil
22
+ expect(details(sn)).to eq [{:uninomial=>
23
23
  {:string=>"Pseudocercospora",
24
24
  :authorship=>"Speg.",
25
25
  :basionymAuthorTeam=>
26
26
  {:authorTeam=>"Speg.", :author=>["Speg."]}}}]
27
- pos(sn).should == {0=>["uninomial", 16], 17=>["author_word", 22]}
27
+ expect(pos(sn)).to eq({0=>["uninomial", 16], 17=>["author_word", 22]})
28
28
  sn = 'Pseudocercospora Spegazzini, 1910'
29
- parse(sn).should_not be_nil
30
- value(sn).should == 'Pseudocercospora Spegazzini 1910'
31
- details(sn).should == [{:uninomial=>
29
+ expect(parse(sn)).to_not be_nil
30
+ expect(value(sn)).to eq 'Pseudocercospora Spegazzini 1910'
31
+ expect(details(sn)).to eq [{:uninomial=>
32
32
  {:string=>"Pseudocercospora",
33
33
  :authorship=>"Spegazzini, 1910",
34
34
  :basionymAuthorTeam=>
35
35
  {:authorTeam=>"Spegazzini",
36
36
  :author=>["Spegazzini"], :year=>"1910"}}}]
37
- pos(sn).should == {0=>["uninomial", 16],
38
- 17=>["author_word", 27], 29=>["year", 33]}
37
+ expect(pos(sn)).to eq({0=>["uninomial", 16],
38
+ 17=>["author_word", 27], 29=>["year", 33]})
39
39
  end
40
40
 
41
- it "should parse uninomials with uninomial ranks" do
41
+ it "parses uninomials with uninomial ranks" do
42
42
  sn = "Epacridaceae trib. Archerieae Crayn & Quinn"
43
- parse(sn).should_not be_nil
44
- details(sn).should == [{:uninomial=>
43
+ expect(parse(sn)).to_not be_nil
44
+ expect(details(sn)).to eq [{:uninomial=>
45
45
  {:string=>"Epacridaceae"},
46
46
  :rank_uninomials=>"trib.",
47
47
  :uninomial2=>{:string=>"Archerieae",
@@ -51,7 +51,7 @@ describe ScientificNameClean do
51
51
  :author=>["Crayn", "Quinn"]}}}]
52
52
  end
53
53
 
54
- it 'should parse names with a valid 2 letter genus' do
54
+ it 'parses names with a valid 2 letter genus' do
55
55
  ["Ca Dyar 1914",
56
56
  "Ea Distant 1911",
57
57
  "Ge Nicéville 1895",
@@ -71,104 +71,191 @@ describe ScientificNameClean do
71
71
  "Qu Durkoop",
72
72
  "As Slipinski 1982",
73
73
  "Ba Solem 1983"].each do |name|
74
- parse(name).should_not be_nil
74
+ expect(parse(name)).to_not be_nil
75
75
  end
76
- canonical('Quoyula').should == 'Quoyula'
76
+ expect(canonical('Quoyula')).to eq 'Quoyula'
77
77
  end
78
78
 
79
- it 'should parse canonical' do
79
+ it 'parses canonical' do
80
80
  sn = 'Pseudocercospora dendrobii'
81
- parse(sn).should_not be_nil
82
- value(sn).should == 'Pseudocercospora dendrobii'
83
- canonical(sn).should == 'Pseudocercospora dendrobii'
84
- details(sn).should == [{:genus=>
81
+ expect(parse(sn)).to_not be_nil
82
+ expect(value(sn)).to eq 'Pseudocercospora dendrobii'
83
+ expect(canonical(sn)).to eq 'Pseudocercospora dendrobii'
84
+ expect(details(sn)).to eq [{:genus=>
85
85
  {:string=>"Pseudocercospora"},
86
86
  :species=>{:string=>"dendrobii"}}]
87
- pos(sn).should == {0=>["genus", 16], 21=>["species", 30]}
87
+ expect(pos(sn)).to eq({0=>["genus", 16], 21=>["species", 30]})
88
88
  end
89
89
 
90
- it 'should parse abbreviated canonical' do
90
+ it 'parses abbreviated canonical' do
91
91
  sn = 'P. dendrobii'
92
- parse(sn).should_not be_nil
93
- value(sn).should == 'P. dendrobii'
92
+ expect(parse(sn)).to_not be_nil
93
+ expect(value(sn)).to eq 'P. dendrobii'
94
94
  sn = 'Ps. dendrobii'
95
- parse(sn).should_not be_nil
96
- value(sn).should == 'Ps. dendrobii'
97
- details(sn).should == [{:genus=>
95
+ expect(parse(sn)).to_not be_nil
96
+ expect(value(sn)).to eq 'Ps. dendrobii'
97
+ expect(details(sn)).to eq [{:genus=>
98
98
  {:string=>"Ps."},
99
99
  :species=>{:string=>"dendrobii"}}]
100
100
  end
101
101
 
102
102
 
103
- it 'should parse species name with author and year' do
103
+ it 'parses species name with author and year' do
104
104
  sn = "Platypus bicaudatulus Schedl 1935"
105
- parse(sn).should_not be_nil
106
- value(sn).should == "Platypus bicaudatulus Schedl 1935"
105
+ expect(parse(sn)).to_not be_nil
106
+ expect(value(sn)).to eq "Platypus bicaudatulus Schedl 1935"
107
107
  sn = "Platypus bicaudatulus Schedl, 1935h"
108
- parse(sn).should_not be_nil
109
- value(sn).should == "Platypus bicaudatulus Schedl 1935"
110
- details(sn).should == [{:genus=>
108
+ expect(parse(sn)).to_not be_nil
109
+ expect(value(sn)).to eq "Platypus bicaudatulus Schedl 1935"
110
+ expect(details(sn)).to eq [{:genus=>
111
111
  {:string=>"Platypus"},
112
112
  :species=>{:string=>"bicaudatulus",
113
113
  :authorship=>"Schedl, 1935h",
114
114
  :basionymAuthorTeam=>
115
115
  {:authorTeam=>"Schedl", :author=>["Schedl"],
116
116
  :year=>"1935"}}}]
117
- pos(sn).should == {0=>["genus", 8],
117
+ expect(pos(sn)).to eq({0=>["genus", 8],
118
118
  9=>["species", 21], 22=>["author_word", 28],
119
- 30=>["year", 35]}
120
- parse("Platypus bicaudatulus Schedl, 1935B").should_not be_nil
119
+ 30=>["year", 35]})
120
+ expect(parse("Platypus bicaudatulus Schedl, 1935B")).to_not be_nil
121
121
  sn = "Platypus bicaudatulus Schedl (1935h)"
122
- parse(sn).should_not be_nil
123
- details(sn).should == [{:genus=>{:string=>"Platypus"}, :species=>{:string=>"bicaudatulus", :authorship=>"Schedl (1935h)", :basionymAuthorTeam=>{:authorTeam=>"Schedl", :author=>["Schedl"], :year=>"1935"}}}]
124
- parse("Platypus bicaudatulus Schedl 1935").should_not be_nil
122
+ expect(parse(sn)).to_not be_nil
123
+ expect(details(sn)).to eq [{:genus=>{:string=>"Platypus"},
124
+ :species=>{:string=>"bicaudatulus", :authorship=>"Schedl (1935h)",
125
+ :basionymAuthorTeam=>{:authorTeam=>"Schedl", :author=>["Schedl"],
126
+ :year=>"1935"}}}]
127
+ expect(parse("Platypus bicaudatulus Schedl 1935")).to_not be_nil
125
128
  end
126
129
 
127
- it 'should parse species name with abbreviated genus, author and year' do
130
+ it 'parses species name with abbreviated genus, author and year' do
128
131
  sn = "P. bicaudatulus Schedl 1935"
129
- parse(sn).should_not be_nil
130
- value(sn).should == "P. bicaudatulus Schedl 1935"
132
+ expect(parse(sn)).to_not be_nil
133
+ expect(value(sn)).to eq "P. bicaudatulus Schedl 1935"
131
134
  sn = "Pl. bicaudatulus Schedl, 1935h"
132
- parse(sn).should_not be_nil
133
- value(sn).should == "Pl. bicaudatulus Schedl 1935"
134
- details(sn).should == [{:genus=>{:string=>"Pl."}, :species=>{:string=>"bicaudatulus", :authorship=>"Schedl, 1935h", :basionymAuthorTeam=>{:authorTeam=>"Schedl", :author=>["Schedl"], :year=>"1935"}}}]
135
+ expect(parse(sn)).not_to be_nil
136
+ expect(value(sn)).to eq "Pl. bicaudatulus Schedl 1935"
137
+ expect(details(sn)).to eq [{:genus=>{:string=>"Pl."},
138
+ :species=>{:string=>"bicaudatulus", :authorship=>"Schedl, 1935h",
139
+ :basionymAuthorTeam=>{:authorTeam=>"Schedl",
140
+ :author=>["Schedl"], :year=>"1935"}}}]
135
141
  sn = "Pla. bicaudatulus Schedl, 1935h"
136
- parse(sn).should_not be_nil
137
- value(sn).should == "Pla. bicaudatulus Schedl 1935"
142
+ expect(parse(sn)).to_not be_nil
143
+ expect(value(sn)).to eq "Pla. bicaudatulus Schedl 1935"
138
144
  end
139
145
 
140
- it "should parse species name with author's postfix f., filius (son of)" do
146
+ it "parses species name with author's postfix f., filius (son of)" do
141
147
  names = [
142
- [ "Platypus bicaudatulus Schedl f. 1935", [{:genus=>{:string=>"Platypus"}, :species=>{:string=>"bicaudatulus", :authorship=>"Schedl f. 1935", :basionymAuthorTeam=>{:authorTeam=>"Schedl f.", :author=>["Schedl f."], :year=>"1935"}}}], 'Platypus bicaudatulus Schedl f. 1935'],
143
- [ "Platypus bicaudatulus Schedl filius 1935", [{:genus=>{:string=>"Platypus"}, :species=>{:string=>"bicaudatulus", :authorship=>"Schedl filius 1935", :basionymAuthorTeam=>{:authorTeam=>"Schedl filius", :author=>["Schedl filius"], :year=>"1935"}}}], 'Platypus bicaudatulus Schedl filius 1935'],
144
- [ "Fimbristylis ovata (Burm. f.) J. Kern", [{:genus=>{:string=>"Fimbristylis"}, :species=>{:string=>"ovata", :authorship=>"(Burm. f.) J. Kern", :combinationAuthorTeam=>{:authorTeam=>"J. Kern", :author=>["J. Kern"]}, :basionymAuthorTeam=>{:authorTeam=>"Burm. f.", :author=>["Burm. f."]}}}], 'Fimbristylis ovata (Burm. f.) J. Kern'],
145
- [ "Carex chordorrhiza Ehrh. ex L. f.", [{:genus=>{:string=>"Carex"}, :species=>{:string=>"chordorrhiza", :authorship=>"Ehrh. ex L. f.", :basionymAuthorTeam=>{:authorTeam=>"Ehrh.", :author=>["Ehrh."], :exAuthorTeam=>{:authorTeam=>"L. f.", :author=>["L. f."]}}}}], 'Carex chordorrhiza Ehrh. ex L. f.'],
146
- [ "Amelanchier arborea var. arborea (Michx. f.) Fernald", [{:genus=>{:string=>"Amelanchier"}, :species=>{:string=>"arborea"}, :infraspecies=>[{:string=>"arborea", :rank=>"var.", :authorship=>"(Michx. f.) Fernald", :combinationAuthorTeam=>{:authorTeam=>"Fernald", :author=>["Fernald"]}, :basionymAuthorTeam=>{:authorTeam=>"Michx. f.", :author=>["Michx. f."]}}]}], 'Amelanchier arborea var. arborea (Michx. f.) Fernald'],
147
- [ "Cerastium arvense var. fuegianum Hook. f.", [{:genus=>{:string=>"Cerastium"}, :species=>{:string=>"arvense"}, :infraspecies=>[{:string=>"fuegianum", :rank=>"var.", :authorship=>"Hook. f.", :basionymAuthorTeam=>{:authorTeam=>"Hook. f.", :author=>["Hook. f."]}}]}], 'Cerastium arvense var. fuegianum Hook. f.'],
148
- [ "Cerastium arvense var. fuegianum Hook.f.", [{:genus=>{:string=>"Cerastium"}, :species=>{:string=>"arvense"}, :infraspecies=>[{:string=>"fuegianum", :rank=>"var.", :authorship=>"Hook.f.", :basionymAuthorTeam=>{:authorTeam=>"Hook.f.", :author=>["Hook.f."]}}]}], 'Cerastium arvense var. fuegianum Hook.f.'],
149
- [ "Cerastium arvense ssp. velutinum var. velutinum (Raf.) Britton f.", [{:genus=>{:string=>"Cerastium"}, :species=>{:string=>"arvense"}, :infraspecies=>[{:string=>"velutinum", :rank=>"ssp."}, {:string=>"velutinum", :rank=>"var.", :authorship=>"(Raf.) Britton f.", :combinationAuthorTeam=>{:authorTeam=>"Britton f.", :author=>["Britton f."]}, :basionymAuthorTeam=>{:authorTeam=>"Raf.", :author=>["Raf."]}}]}], "Cerastium arvense ssp. velutinum var. velutinum (Raf.) Britton f."],
150
- ["Amelanchier arborea f. hirsuta (Michx. f.) Fernald", [{:infraspecies=>[{:basionymAuthorTeam=>{:author=>["Michx. f."], :authorTeam=>"Michx. f."}, :string=>"hirsuta", :rank=>"f.", :combinationAuthorTeam=>{:author=>["Fernald"], :authorTeam=>"Fernald"}, :authorship=>"(Michx. f.) Fernald"}], :genus=>{:string=>"Amelanchier"}, :species=>{:string=>"arborea"}}], "Amelanchier arborea f. hirsuta (Michx. f.) Fernald"],
151
- ["Betula pendula fo. dalecarlica (L. f.) C.K. Schneid.", [{:infraspecies=>[{:basionymAuthorTeam=>{:author=>["L. f."], :authorTeam=>"L. f."}, :string=>"dalecarlica", :rank=>"fo.", :combinationAuthorTeam=>{:author=>["C.K. Schneid."], :authorTeam=>"C.K. Schneid."}, :authorship=>"(L. f.) C.K. Schneid."}], :genus=>{:string=>"Betula"}, :species=>{:string=>"pendula"}}], "Betula pendula fo. dalecarlica (L. f.) C.K. Schneid."],
152
- ["Racomitrium canescens f. ericoides (F. Weber ex Brid.) Mönk.", [{:genus=>{:string=>"Racomitrium"}, :species=>{:string=>"canescens"}, :infraspecies=>[{:string=>"ericoides", :rank=>"f.", :authorship=>"(F. Weber ex Brid.) Mönk.", :combinationAuthorTeam=>{:authorTeam=>"Mönk.", :author=>["Mönk."]}, :basionymAuthorTeam=>{:authorTeam=>"F. Weber", :author=>["F. Weber"], :exAuthorTeam=>{:authorTeam=>"Brid.", :author=>["Brid."]}}}]}], "Racomitrium canescens f. ericoides (F. Weber ex Brid.) Mönk."],
153
- ["Racomitrium canescens forma ericoides (F. Weber ex Brid.) Mönk.", [{:genus=>{:string=>"Racomitrium"}, :species=>{:string=>"canescens"}, :infraspecies=>[{:string=>"ericoides", :rank=>"forma", :authorship=>"(F. Weber ex Brid.) Mönk.", :combinationAuthorTeam=>{:authorTeam=>"Mönk.", :author=>["Mönk."]}, :basionymAuthorTeam=>{:authorTeam=>"F. Weber", :author=>["F. Weber"], :exAuthorTeam=>{:authorTeam=>"Brid.", :author=>["Brid."]}}}]}], "Racomitrium canescens forma ericoides (F. Weber ex Brid.) Mönk."],
154
- ["Peristernia nassatula forskali Tapparone-Canefri 1875", [{:genus=>{:string=>"Peristernia"}, :species=>{:string=>"nassatula"}, :infraspecies=>[{:string=>"forskali", :rank=>"n/a", :authorship=>"Tapparone-Canefri 1875", :basionymAuthorTeam=>{:authorTeam=>"Tapparone-Canefri", :author=>["Tapparone-Canefri"], :year=>"1875"}}]}], "Peristernia nassatula forskali Tapparone-Canefri 1875"],
148
+ [ "Platypus bicaudatulus Schedl f. 1935", [{:genus=>{:string=>"Platypus"},
149
+ :species=>{:string=>"bicaudatulus", :authorship=>"Schedl f. 1935",
150
+ :basionymAuthorTeam=>{:authorTeam=>"Schedl f.",
151
+ :author=>["Schedl f."], :year=>"1935"}}}],
152
+ 'Platypus bicaudatulus Schedl f. 1935'],
153
+ ["Platypus bicaudatulus Schedl filius 1935",
154
+ [{:genus=>{:string=>"Platypus"},
155
+ :species=>{:string=>"bicaudatulus",
156
+ :authorship=>"Schedl filius 1935",
157
+ :basionymAuthorTeam=>{:authorTeam=>"Schedl filius",
158
+ :author=>["Schedl filius"], :year=>"1935"}}}],
159
+ 'Platypus bicaudatulus Schedl filius 1935'],
160
+ [ "Fimbristylis ovata (Burm. f.) J. Kern",
161
+ [{:genus=>{:string=>"Fimbristylis"}, :species=>{:string=>"ovata",
162
+ :authorship=>"(Burm. f.) J. Kern",
163
+ :combinationAuthorTeam=>{:authorTeam=>"J. Kern",
164
+ :author=>["J. Kern"]},
165
+ :basionymAuthorTeam=>{:authorTeam=>"Burm. f.",
166
+ :author=>["Burm. f."]}}}], 'Fimbristylis ovata (Burm. f.) J. Kern'],
167
+ [ "Carex chordorrhiza Ehrh. ex L. f.",
168
+ [{:genus=>{:string=>"Carex"}, :species=>{:string=>"chordorrhiza",
169
+ :authorship=>"Ehrh. ex L. f.",
170
+ :basionymAuthorTeam=>{:authorTeam=>"Ehrh.",
171
+ :author=>["Ehrh."], :exAuthorTeam=>{:authorTeam=>"L. f.",
172
+ :author=>["L. f."]}}}}], 'Carex chordorrhiza Ehrh. ex L. f.'],
173
+ [ "Amelanchier arborea var. arborea (Michx. f.) Fernald",
174
+ [{:genus=>{:string=>"Amelanchier"}, :species=>{:string=>"arborea"},
175
+ :infraspecies=>[{:string=>"arborea", :rank=>"var.",
176
+ :authorship=>"(Michx. f.) Fernald", :combinationAuthorTeam=>{
177
+ :authorTeam=>"Fernald", :author=>["Fernald"]},
178
+ :basionymAuthorTeam=>{:authorTeam=>"Michx. f.",
179
+ :author=>["Michx. f."]}}]}],
180
+ 'Amelanchier arborea var. arborea (Michx. f.) Fernald'],
181
+ [ "Cerastium arvense var. fuegianum Hook. f.",
182
+ [{:genus=>{:string=>"Cerastium"}, :species=>{:string=>"arvense"},
183
+ :infraspecies=>[{:string=>"fuegianum", :rank=>"var.",
184
+ :authorship=>"Hook. f.",
185
+ :basionymAuthorTeam=>{:authorTeam=>"Hook. f.",
186
+ :author=>["Hook. f."]}}]}],
187
+ 'Cerastium arvense var. fuegianum Hook. f.'],
188
+ [ "Cerastium arvense var. fuegianum Hook.f.",
189
+ [{:genus=>{:string=>"Cerastium"}, :species=>{:string=>"arvense"},
190
+ :infraspecies=>[{:string=>"fuegianum", :rank=>"var.",
191
+ :authorship=>"Hook.f.", :basionymAuthorTeam=>{
192
+ :authorTeam=>"Hook.f.", :author=>["Hook.f."]}}]}],
193
+ 'Cerastium arvense var. fuegianum Hook.f.'],
194
+ [ "Cerastium arvense ssp. velutinum var. velutinum (Raf.) Britton f.",
195
+ [{:genus=>{:string=>"Cerastium"}, :species=>{:string=>"arvense"},
196
+ :infraspecies=>[{:string=>"velutinum", :rank=>"ssp."},
197
+ {:string=>"velutinum", :rank=>"var.",
198
+ :authorship=>"(Raf.) Britton f.",
199
+ :combinationAuthorTeam=>{:authorTeam=>"Britton f.",
200
+ :author=>["Britton f."]}, :basionymAuthorTeam=>{:authorTeam=>"Raf.",
201
+ :author=>["Raf."]}}]}],
202
+ "Cerastium arvense ssp. velutinum var. velutinum (Raf.) Britton f."],
203
+ ["Amelanchier arborea f. hirsuta (Michx. f.) Fernald",
204
+ [{:infraspecies=>[{:basionymAuthorTeam=>{:author=>["Michx. f."],
205
+ :authorTeam=>"Michx. f."}, :string=>"hirsuta", :rank=>"f.",
206
+ :combinationAuthorTeam=>{:author=>["Fernald"], :authorTeam=>"Fernald"},
207
+ :authorship=>"(Michx. f.) Fernald"}], :genus=>{:string=>"Amelanchier"},
208
+ :species=>{:string=>"arborea"}}],
209
+ "Amelanchier arborea f. hirsuta (Michx. f.) Fernald"],
210
+ ["Betula pendula fo. dalecarlica (L. f.) C.K. Schneid.",
211
+ [{:infraspecies=>[{:basionymAuthorTeam=>{:author=>["L. f."],
212
+ :authorTeam=>"L. f."}, :string=>"dalecarlica", :rank=>"fo.",
213
+ :combinationAuthorTeam=>{:author=>["C.K. Schneid."],
214
+ :authorTeam=>"C.K. Schneid."}, :authorship=>"(L. f.) C.K. Schneid."}],
215
+ :genus=>{:string=>"Betula"}, :species=>{:string=>"pendula"}}],
216
+ "Betula pendula fo. dalecarlica (L. f.) C.K. Schneid."],
217
+ ["Racomitrium canescens f. ericoides (F. Weber ex Brid.) Mönk.",
218
+ [{:genus=>{:string=>"Racomitrium"}, :species=>{:string=>"canescens"},
219
+ :infraspecies=>[{:string=>"ericoides", :rank=>"f.",
220
+ :authorship=>"(F. Weber ex Brid.) Mönk.",
221
+ :combinationAuthorTeam=>{:authorTeam=>"Mönk.", :author=>["Mönk."]},
222
+ :basionymAuthorTeam=>{:authorTeam=>"F. Weber",
223
+ :author=>["F. Weber"], :exAuthorTeam=>{:authorTeam=>"Brid.",
224
+ :author=>["Brid."]}}}]}],
225
+ "Racomitrium canescens f. ericoides (F. Weber ex Brid.) Mönk."],
226
+ ["Racomitrium canescens forma ericoides (F. Weber ex Brid.) Mönk.",
227
+ [{:genus=>{:string=>"Racomitrium"}, :species=>{:string=>"canescens"},
228
+ :infraspecies=>[{:string=>"ericoides", :rank=>"forma",
229
+ :authorship=>"(F. Weber ex Brid.) Mönk.",
230
+ :combinationAuthorTeam=>{:authorTeam=>"Mönk.", :author=>["Mönk."]},
231
+ :basionymAuthorTeam=>{:authorTeam=>"F. Weber", :author=>["F. Weber"],
232
+ :exAuthorTeam=>{:authorTeam=>"Brid.", :author=>["Brid."]}}}]}],
233
+ "Racomitrium canescens forma ericoides (F. Weber ex Brid.) Mönk."],
234
+ ["Peristernia nassatula forskali Tapparone-Canefri 1875",
235
+ [{:genus=>{:string=>"Peristernia"}, :species=>{:string=>"nassatula"},
236
+ :infraspecies=>[{:string=>"forskali", :rank=>"n/a",
237
+ :authorship=>"Tapparone-Canefri 1875", :basionymAuthorTeam=>{
238
+ :authorTeam=>"Tapparone-Canefri", :author=>["Tapparone-Canefri"],
239
+ :year=>"1875"}}]}],
240
+ "Peristernia nassatula forskali Tapparone-Canefri 1875"],
155
241
  ]
156
242
  names.each do |sn, sn_details, sn_value|
157
- parse(sn).should_not be_nil
158
- details(sn).should == sn_details
159
- value(sn).should == sn_value
243
+ expect(parse(sn)).to_not be_nil
244
+ expect(details(sn)).to eq sn_details
245
+ expect(value(sn)).to eq sn_value
160
246
  end
161
247
  end
162
248
 
163
- it 'should parse genus with "?"' do
249
+ it 'parses genus with "?"' do
164
250
  sn = "Ferganoconcha? oblonga"
165
- parse(sn).should_not be_nil
166
- value(sn).should == "Ferganoconcha oblonga"
167
- details(sn).should == [{:genus=>{:string=>"Ferganoconcha"}, :species=>{:string=>"oblonga"}}]
168
- pos(sn).should == {0=>["genus", 14], 15=>["species", 22]}
251
+ expect(parse(sn)).to_not be_nil
252
+ expect(value(sn)).to eq "Ferganoconcha oblonga"
253
+ expect(details(sn)).to eq [{:genus=>{:string=>"Ferganoconcha"},
254
+ :species=>{:string=>"oblonga"}}]
255
+ expect(pos(sn)).to eq({0=>["genus", 14], 15=>["species", 22]})
169
256
  end
170
257
 
171
- it 'should parse æ in the name' do
258
+ it 'parses æ in the name' do
172
259
  names = [
173
260
  ["Læptura laetifica Dow, 1913", "Laeptura laetifica Dow 1913"],
174
261
  ["Leptura lætifica Dow, 1913", "Leptura laetifica Dow 1913"],
@@ -182,345 +269,474 @@ describe ScientificNameClean do
182
269
  ['Cerambyx thomæ Gmelin J. F., 1790', 'Cerambyx thomae Gmelin J. F. 1790']
183
270
  ]
184
271
  names.each do |name_pair|
185
- parse(name_pair[0]).should_not be_nil
186
- value(name_pair[0]).should == name_pair[1]
272
+ expect(parse(name_pair[0])).to_not be_nil
273
+ expect(value(name_pair[0])).to eq name_pair[1]
187
274
  end
188
275
  end
189
276
 
190
- it 'should parse names with e-umlaut' do
277
+ it 'parses names with e-umlaut' do
191
278
  sn = 'Kalanchoë tuberosa'
192
- canonical(sn).should == 'Kalanchoe tuberosa'
279
+ expect(canonical(sn)).to eq 'Kalanchoe tuberosa'
193
280
  sn = 'Isoëtes asplundii H. P. Fuchs'
194
- canonical(sn).should == 'Isoetes asplundii'
281
+ expect(canonical(sn)).to eq 'Isoetes asplundii'
195
282
  end
196
283
 
197
- it 'should parse infragenus (ICZN code)' do
284
+ it 'parses infragenus (ICZN code)' do
198
285
  sn = "Hegeter (Hegeter) intercedens Lindberg H 1950"
199
- parse(sn).should_not be_nil
200
- value(sn).should == "Hegeter (Hegeter) intercedens Lindberg H 1950"
201
- canonical(sn).should == "Hegeter intercedens"
202
- details(sn).should == [{:genus=>{:string=>"Hegeter"}, :infragenus=>{:string=>"Hegeter"}, :species=>{:string=>"intercedens", :authorship=>"Lindberg H 1950", :basionymAuthorTeam=>{:authorTeam=>"Lindberg H", :author=>["Lindberg H"], :year=>"1950"}}}]
203
- pos(sn).should == {0=>["genus", 7], 9=>["infragenus", 16], 18=>["species", 29], 30=>["author_word", 38], 39=>["author_word", 40], 41=>["year", 45]}
286
+ expect(parse(sn)).to_not be_nil
287
+ expect(value(sn)).to eq "Hegeter (Hegeter) intercedens Lindberg H 1950"
288
+ expect(canonical(sn)).to eq "Hegeter intercedens"
289
+ expect(details(sn)).to eq [{:genus=>{:string=>"Hegeter"},
290
+ :infragenus=>{:string=>"Hegeter"}, :species=>{:string=>"intercedens",
291
+ :authorship=>"Lindberg H 1950",
292
+ :basionymAuthorTeam=>{:authorTeam=>"Lindberg H",
293
+ :author=>["Lindberg H"], :year=>"1950"}}}]
294
+ expect(pos(sn)).to eq({0=>["genus", 7], 9=>["infragenus", 16],
295
+ 18=>["species", 29], 30=>["author_word", 38],
296
+ 39=>["author_word", 40], 41=>["year", 45]})
204
297
  sn = "Ixodes (Ixodes) hexagonus hexagonus Neumann, 1911"
205
- canonical(sn).should == "Ixodes hexagonus hexagonus"
298
+ expect(canonical(sn)).to eq "Ixodes hexagonus hexagonus"
206
299
  sn = "Brachytrypus (B.) grandidieri"
207
- canonical(sn).should == "Brachytrypus grandidieri"
208
- details(sn).should == [{:genus=>{:string=>"Brachytrypus"}, :infragenus=>{:string=>"B."}, :species=>{:string=>"grandidieri"}}]
300
+ expect(canonical(sn)).to eq "Brachytrypus grandidieri"
301
+ expect(details(sn)).to eq [{:genus=>{:string=>"Brachytrypus"},
302
+ :infragenus=>{:string=>"B."}, :species=>{:string=>"grandidieri"}}]
209
303
  sn = "Empis (Argyrandrus) Bezzi 1909"
210
- details(sn).should == [{:uninomial=>{:string=>"Empis", :infragenus=>{:string=>"Argyrandrus"}, :authorship=>"Bezzi 1909", :basionymAuthorTeam=>{:authorTeam=>"Bezzi", :author=>["Bezzi"], :year=>"1909"}}}]
304
+ expect(details(sn)).to eq [{:uninomial=>{:string=>"Empis",
305
+ :infragenus=>{:string=>"Argyrandrus"}, :authorship=>"Bezzi 1909",
306
+ :basionymAuthorTeam=>{:authorTeam=>"Bezzi",
307
+ :author=>["Bezzi"], :year=>"1909"}}}]
211
308
  sn = "Platydoris (Bergh )"
212
- details(sn).should == [{:uninomial=>{:string=>"Platydoris", :infragenus=>{:string=>"Bergh"}}}]
213
- value(sn).should == "Platydoris (Bergh)"
309
+ expect(details(sn)).to eq [{:uninomial=>{:string=>"Platydoris",
310
+ :infragenus=>{:string=>"Bergh"}}}]
311
+ expect(value(sn)).to eq "Platydoris (Bergh)"
214
312
  sn = "Platydoris (B.)"
215
- details(sn).should == [{:uninomial=>{:string=>"Platydoris", :infragenus=>{:string=>"B."}}}]
313
+ expect(details(sn)).to eq [{:uninomial=>{:string=>"Platydoris",
314
+ :infragenus=>{:string=>"B."}}}]
216
315
  end
217
316
 
218
- it 'should parse several authors without a year' do
317
+ it 'parses several authors without a year' do
219
318
  sn = "Pseudocercospora dendrobii U. Braun & Crous"
220
- parse(sn).should_not be_nil
221
- value(sn).should == "Pseudocercospora dendrobii U. Braun & Crous"
222
- canonical(sn).should == "Pseudocercospora dendrobii"
223
- details(sn).should == [{:genus=>{:string=>"Pseudocercospora"}, :species=>{:string=>"dendrobii", :authorship=>"U. Braun & Crous", :basionymAuthorTeam=>{:authorTeam=>"U. Braun & Crous", :author=>["U. Braun", "Crous"]}}}]
224
- pos(sn).should == {0=>["genus", 16], 17=>["species", 26], 27=>["author_word", 29], 30=>["author_word", 35], 38=>["author_word", 43]}
319
+ expect(parse(sn)).to_not be be_nil
320
+ expect(value(sn)).to eq "Pseudocercospora dendrobii U. Braun & Crous"
321
+ expect(canonical(sn)).to eq "Pseudocercospora dendrobii"
322
+ expect(details(sn)).to eq [{:genus=>{:string=>"Pseudocercospora"},
323
+ :species=>{:string=>"dendrobii", :authorship=>"U. Braun & Crous",
324
+ :basionymAuthorTeam=>{:authorTeam=>"U. Braun & Crous",
325
+ :author=>["U. Braun", "Crous"]}}}]
326
+ expect(pos(sn)).to eq({0=>["genus", 16], 17=>["species", 26],
327
+ 27=>["author_word", 29], 30=>["author_word", 35],
328
+ 38=>["author_word", 43]})
225
329
  sn = "Pseudocercospora dendrobii U. Braun and Crous"
226
- parse(sn).should_not be_nil
227
- value(sn).should == "Pseudocercospora dendrobii U. Braun & Crous"
228
- pos(sn).should == {0=>["genus", 16], 17=>["species", 26], 27=>["author_word", 29], 30=>["author_word", 35], 40=>["author_word", 45]}
330
+ expect(parse(sn)).to_not be_nil
331
+ expect(value(sn)).to eq "Pseudocercospora dendrobii U. Braun & Crous"
332
+ expect(pos(sn)).to eq({0=>["genus", 16], 17=>["species", 26],
333
+ 27=>["author_word", 29], 30=>["author_word", 35],
334
+ 40=>["author_word", 45]})
229
335
  sn = "Pseudocercospora dendrobii U. Braun et Crous"
230
- parse(sn).should_not be_nil
231
- value(sn).should == "Pseudocercospora dendrobii U. Braun & Crous"
336
+ expect(parse(sn)).to_not be_nil
337
+ expect(value(sn)).to eq "Pseudocercospora dendrobii U. Braun & Crous"
232
338
  sn = "Arthopyrenia hyalospora(Nyl.)R.C. Harris"
233
- parse(sn).should_not be_nil
234
- value(sn).should == "Arthopyrenia hyalospora (Nyl.) R.C. Harris"
235
- canonical(sn).should == "Arthopyrenia hyalospora"
236
- details(sn).should == [{:genus=>{:string=>"Arthopyrenia"}, :species=>{:string=>"hyalospora", :authorship=>"(Nyl.)R.C. Harris", :combinationAuthorTeam=>{:authorTeam=>"R.C. Harris", :author=>["R.C. Harris"]}, :basionymAuthorTeam=>{:authorTeam=>"Nyl.", :author=>["Nyl."]}}}]
339
+ expect(parse(sn)).to_not be_nil
340
+ expect(value(sn)).to eq "Arthopyrenia hyalospora (Nyl.) R.C. Harris"
341
+ expect(canonical(sn)).to eq "Arthopyrenia hyalospora"
342
+ expect(details(sn)).to eq [{:genus=>{:string=>"Arthopyrenia"},
343
+ :species=>{:string=>"hyalospora", :authorship=>"(Nyl.)R.C. Harris",
344
+ :combinationAuthorTeam=>{:authorTeam=>"R.C. Harris",
345
+ :author=>["R.C. Harris"]},
346
+ :basionymAuthorTeam=>{:authorTeam=>"Nyl.", :author=>["Nyl."]}}}]
237
347
  end
238
348
 
239
- it 'should parse several authors with a year' do
349
+ it 'parses several authors with a year' do
240
350
  sn = "Pseudocercospora dendrobii U. Braun & Crous 2003"
241
- parse(sn).should_not be_nil
242
- value(sn).should == "Pseudocercospora dendrobii U. Braun & Crous 2003"
243
- canonical(sn).should == "Pseudocercospora dendrobii"
244
- details(sn).should == [{:genus=>{:string=>"Pseudocercospora"}, :species=>{:string=>"dendrobii", :authorship=>"U. Braun & Crous 2003", :basionymAuthorTeam=>{:authorTeam=>"U. Braun & Crous", :author=>["U. Braun", "Crous"], :year=>"2003"}}}]
245
- pos(sn).should == {0=>["genus", 16], 17=>["species", 26], 27=>["author_word", 29], 30=>["author_word", 35], 38=>["author_word", 43], 44=>["year", 48]}
351
+ expect(parse(sn)).to_not be_nil
352
+ expect(value(sn)).to eq "Pseudocercospora dendrobii U. Braun & Crous 2003"
353
+ expect(canonical(sn)).to eq "Pseudocercospora dendrobii"
354
+ expect(details(sn)).to eq [{:genus=>{:string=>"Pseudocercospora"},
355
+ :species=>{:string=>"dendrobii", :authorship=>"U. Braun & Crous 2003",
356
+ :basionymAuthorTeam=>{:authorTeam=>"U. Braun & Crous",
357
+ :author=>["U. Braun", "Crous"], :year=>"2003"}}}]
358
+ expect(pos(sn)).to eq({0=>["genus", 16], 17=>["species", 26],
359
+ 27=>["author_word", 29], 30=>["author_word", 35],
360
+ 38=>["author_word", 43], 44=>["year", 48]})
246
361
  sn = "Pseudocercospora dendrobii Crous, 2003"
247
- parse(sn).should_not be_nil
362
+ expect(parse(sn)).to_not be_nil
248
363
  end
249
364
 
250
- it 'should parse basionym authors in parenthesis' do
365
+ it 'parses basionym authors in parenthesis' do
251
366
  sn = "Zophosis persis (Chatanay, 1914)"
252
- parse(sn).should_not be_nil
253
- details(sn).should == [{:genus=>{:string=>"Zophosis"}, :species=>{:string=>"persis", :authorship=>"(Chatanay, 1914)", :basionymAuthorTeam=>{:authorTeam=>"Chatanay", :author=>["Chatanay"], :year=>"1914"}}}]
367
+ expect(parse(sn)).to_not be_nil
368
+ expect(details(sn)).to eq [{:genus=>{:string=>"Zophosis"},
369
+ :species=>{:string=>"persis", :authorship=>"(Chatanay, 1914)",
370
+ :basionymAuthorTeam=>{:authorTeam=>"Chatanay",
371
+ :author=>["Chatanay"], :year=>"1914"}}}]
254
372
  sn = "Zophosis persis (Chatanay 1914)"
255
- parse(sn).should_not be_nil
256
- details(sn).should == [{:genus=>{:string=>"Zophosis"}, :species=>{:string=>"persis", :authorship=>"(Chatanay 1914)", :basionymAuthorTeam=>{:authorTeam=>"Chatanay", :author=>["Chatanay"], :year=>"1914"}}}]
373
+ expect(parse(sn)).to_not be_nil
374
+ expect(details(sn)).to eq [{:genus=>{:string=>"Zophosis"},
375
+ :species=>{:string=>"persis", :authorship=>"(Chatanay 1914)",
376
+ :basionymAuthorTeam=>{:authorTeam=>"Chatanay",
377
+ :author=>["Chatanay"], :year=>"1914"}}}]
257
378
  sn = "Zophosis persis (Chatanay), 1914"
258
- parse(sn).should_not be_nil
259
- value(sn).should == "Zophosis persis (Chatanay 1914)"
260
- details(sn).should == [{:genus=>{:string=>"Zophosis"}, :species=>{:string=>"persis", :authorship=>"(Chatanay), 1914", :basionymAuthorTeam=>{:author_team=>"(Chatanay), 1914", :author=>["Chatanay"], :year=>"1914"}}}]
261
- pos(sn).should == {0=>["genus", 8], 9=>["species", 15], 17=>["author_word", 25], 28=>["year", 32]}
262
- parse("Zophosis persis (Chatanay) 1914").should_not be_nil
263
- #parse("Zophosis persis Chatanay (1914)").should_not be_nil
264
- end
265
-
266
- it "should be able to parse name with identificaation annotation -- aff cf sp spp" do
379
+ expect(parse(sn)).to_not be_nil
380
+ expect(value(sn)).to eq "Zophosis persis (Chatanay 1914)"
381
+ expect(details(sn)).to eq [{:genus=>{:string=>"Zophosis"},
382
+ :species=>{:string=>"persis", :authorship=>"(Chatanay), 1914",
383
+ :basionymAuthorTeam=>{:author_team=>"(Chatanay), 1914",
384
+ :author=>["Chatanay"], :year=>"1914"}}}]
385
+ expect(pos(sn)).to eq({0=>["genus", 8], 9=>["species", 15],
386
+ 17=>["author_word", 25], 28=>["year", 32]})
387
+ expect(parse("Zophosis persis (Chatanay) 1914")).to_not be_nil
388
+ #parse("Zophosis persis Chatanay (1914)")).to_not be_nil
389
+ end
390
+
391
+ it "parses name with identificaation annotation -- aff cf sp spp" do
267
392
  sn = 'Diplocephalus aff. procerus Thaler, 1972'
268
- details(sn).should == [{:genus=>{:string=>"Diplocephalus"}, :annotation_identification=>"aff.", :ignored=>{:species=>{:string=>"procerus", :authorship=>"Thaler, 1972", :basionymAuthorTeam=>{:authorTeam=>"Thaler", :author=>["Thaler"], :year=>"1972"}}}}]
393
+ expect(details(sn)).to eq [{:genus=>{:string=>"Diplocephalus"},
394
+ :annotation_identification=>"aff.",
395
+ :ignored=>{:species=>{:string=>"procerus", :authorship=>"Thaler, 1972",
396
+ :basionymAuthorTeam=>{:authorTeam=>"Thaler",
397
+ :author=>["Thaler"], :year=>"1972"}}}}]
269
398
  sn = 'Diplocephalus aff procerus Thaler, 1972'
270
- details(sn).should == [{:genus=>{:string=>"Diplocephalus"}, :annotation_identification=>"aff", :ignored=>{:species=>{:string=>"procerus", :authorship=>"Thaler, 1972", :basionymAuthorTeam=>{:authorTeam=>"Thaler", :author=>["Thaler"], :year=>"1972"}}}}]
399
+ expect(details(sn)).to eq [{:genus=>{:string=>"Diplocephalus"},
400
+ :annotation_identification=>"aff", :ignored=>{:species=>
401
+ {:string=>"procerus", :authorship=>"Thaler, 1972",
402
+ :basionymAuthorTeam=>{:authorTeam=>"Thaler",
403
+ :author=>["Thaler"], :year=>"1972"}}}}]
271
404
  sn = 'Diplocephalus affprocerus Thaler, 1972'
272
- details(sn).should == [{:genus=>{:string=>"Diplocephalus"}, :species=>{:string=>"affprocerus", :authorship=>"Thaler, 1972", :basionymAuthorTeam=>{:authorTeam=>"Thaler", :author=>["Thaler"], :year=>"1972"}}}]
405
+ expect(details(sn)).to eq [{:genus=>{:string=>"Diplocephalus"},
406
+ :species=>{:string=>"affprocerus", :authorship=>"Thaler, 1972",
407
+ :basionymAuthorTeam=>{:authorTeam=>"Thaler",
408
+ :author=>["Thaler"], :year=>"1972"}}}]
273
409
  sn = 'Diplocephalus cf. procerus Thaler, 1972'
274
- details(sn).should == [{:genus=>{:string=>"Diplocephalus"}, :annotation_identification=>"cf.", :species=>{:species=>{:string=>"procerus", :authorship=>"Thaler, 1972", :basionymAuthorTeam=>{:authorTeam=>"Thaler", :author=>["Thaler"], :year=>"1972"}}}}]
410
+ expect(details(sn)).to eq [{:genus=>{:string=>"Diplocephalus"},
411
+ :annotation_identification=>"cf.", :species=>{:species=>
412
+ {:string=>"procerus", :authorship=>"Thaler, 1972",
413
+ :basionymAuthorTeam=>{:authorTeam=>"Thaler",
414
+ :author=>["Thaler"], :year=>"1972"}}}}]
275
415
  sn = 'Diplocephalus cf procerus Thaler, 1972'
276
- details(sn).should == [{:genus=>{:string=>"Diplocephalus"}, :annotation_identification=>"cf", :species=>{:species=>{:string=>"procerus", :authorship=>"Thaler, 1972", :basionymAuthorTeam=>{:authorTeam=>"Thaler", :author=>["Thaler"], :year=>"1972"}}}}]
416
+ expect(details(sn)).to eq [{:genus=>{:string=>"Diplocephalus"},
417
+ :annotation_identification=>"cf", :species=>
418
+ {:species=>{:string=>"procerus", :authorship=>"Thaler, 1972",
419
+ :basionymAuthorTeam=>{:authorTeam=>"Thaler",
420
+ :author=>["Thaler"], :year=>"1972"}}}}]
277
421
  sn = 'Sphingomonas sp. 37'
278
- details(sn).should == [{:genus=>{:string=>"Sphingomonas"}, :annotation_identification=>"sp.", :ignored=>{:unparsed=>"37"}}]
422
+ expect(details(sn)).to eq [{:genus=>{:string=>"Sphingomonas"},
423
+ :annotation_identification=>"sp.", :ignored=>{:unparsed=>"37"}}]
279
424
  sn = "Thryothorus leucotis spp. bogotensis"
280
- details(sn).should == [{:genus=>{:string=>"Thryothorus"}, :species=>{:string=>"leucotis"}, :infraspecies=>[{:annotation_identification=>"spp.", :ignored=>{:infraspecies=>{:string=>"bogotensis", :rank=>"n/a"}}}]}]
425
+ expect(details(sn)).to eq [{:genus=>{:string=>"Thryothorus"},
426
+ :species=>{:string=>"leucotis"}, :infraspecies=>
427
+ [{:annotation_identification=>"spp.",
428
+ :ignored=>{:infraspecies=>{:string=>"bogotensis", :rank=>"n/a"}}}]}]
281
429
  end
282
430
 
283
- it 'should parse scientific name' do
431
+ it 'parses scientific name' do
284
432
  sn = "Pseudocercospora dendrobii(H.C. Burnett)U. Braun & Crous 2003"
285
- parse(sn).should_not be_nil
286
- value(sn).should == "Pseudocercospora dendrobii (H.C. Burnett) U. Braun & Crous 2003"
287
- canonical(sn).should == "Pseudocercospora dendrobii"
288
- details(sn).should == [{:genus=>{:string=>"Pseudocercospora"}, :species=>{:string=>"dendrobii", :authorship=>"(H.C. Burnett)U. Braun & Crous 2003", :combinationAuthorTeam=>{:authorTeam=>"U. Braun & Crous", :author=>["U. Braun", "Crous"], :year=>"2003"}, :basionymAuthorTeam=>{:authorTeam=>"H.C. Burnett", :author=>["H.C. Burnett"]}}}]
289
- sn = "Pseudocercospora dendrobii(H.C. Burnett,1873)U. Braun & Crous 2003"
290
- parse(sn).should_not be_nil
291
- value(sn).should == "Pseudocercospora dendrobii (H.C. Burnett 1873) U. Braun & Crous 2003"
292
- details(sn).should == [{:genus=>{:string=>"Pseudocercospora"}, :species=>{:string=>"dendrobii", :authorship=>"(H.C. Burnett,1873)U. Braun & Crous 2003", :combinationAuthorTeam=>{:authorTeam=>"U. Braun & Crous", :author=>["U. Braun", "Crous"], :year=>"2003"}, :basionymAuthorTeam=>{:authorTeam=>"H.C. Burnett", :author=>["H.C. Burnett"], :year=>"1873"}}}]
293
- end
294
-
295
- it 'should parse several authors with several years' do
433
+ expect(parse(sn)).to_not be_nil
434
+ expect(value(sn)).to eq "Pseudocercospora dendrobii (H.C. Burnett) "\
435
+ "U. Braun & Crous 2003"
436
+ expect(canonical(sn)).to eq "Pseudocercospora dendrobii"
437
+ expect(details(sn)).to eq [{:genus=>{:string=>"Pseudocercospora"},
438
+ :species=>{:string=>"dendrobii",
439
+ :authorship=>"(H.C. Burnett)U. Braun & Crous 2003",
440
+ :combinationAuthorTeam=>{:authorTeam=>"U. Braun & Crous",
441
+ :author=>["U. Braun", "Crous"], :year=>"2003"},
442
+ :basionymAuthorTeam=>{:authorTeam=>"H.C. Burnett",
443
+ :author=>["H.C. Burnett"]}}}]
444
+ sn = "Pseudocercospora dendrobii(H.C. Burnett,1873)"\
445
+ "U. Braun & Crous 2003"
446
+ expect(parse(sn)).to_not be_nil
447
+ expect(value(sn)).to eq "Pseudocercospora dendrobii (H.C. Burnett 1873) "\
448
+ "U. Braun & Crous 2003"
449
+ expect(details(sn)).to eq [{:genus=>{:string=>"Pseudocercospora"},
450
+ :species=>{:string=>"dendrobii",
451
+ :authorship=>"(H.C. Burnett,1873)U. Braun & Crous 2003",
452
+ :combinationAuthorTeam=>{:authorTeam=>"U. Braun & Crous",
453
+ :author=>["U. Braun", "Crous"], :year=>"2003"},
454
+ :basionymAuthorTeam=>{:authorTeam=>"H.C. Burnett",
455
+ :author=>["H.C. Burnett"], :year=>"1873"}}}]
456
+ end
457
+
458
+ it 'parses several authors with several years' do
296
459
  sn = "Pseudocercospora dendrobii (H.C. Burnett 1883) U. Braun & Crous 2003"
297
- parse(sn).should_not be_nil
298
- value(sn).should == "Pseudocercospora dendrobii (H.C. Burnett 1883) U. Braun & Crous 2003"
299
- canonical(sn).should == "Pseudocercospora dendrobii"
300
- details(sn).should == [{:genus=>{:string=>"Pseudocercospora"}, :species=>{:string=>"dendrobii", :authorship=>"(H.C. Burnett 1883) U. Braun & Crous 2003", :combinationAuthorTeam=>{:authorTeam=>"U. Braun & Crous", :author=>["U. Braun", "Crous"], :year=>"2003"}, :basionymAuthorTeam=>{:authorTeam=>"H.C. Burnett", :author=>["H.C. Burnett"], :year=>"1883"}}}]
301
- pos(sn).should == {0=>["genus", 16], 17=>["species", 26], 28=>["author_word", 32], 33=>["author_word", 40], 41=>["year", 45], 47=>["author_word", 49], 50=>["author_word", 55], 58=>["author_word", 63], 64=>["year", 68]}
302
- end
303
-
304
- it "should parse name with subspecies without rank Zoological Code" do
460
+ expect(parse(sn)).to_not be_nil
461
+ expect(value(sn)).to eq "Pseudocercospora dendrobii (H.C. Burnett 1883) "\
462
+ "U. Braun & Crous 2003"
463
+ expect(canonical(sn)).to eq "Pseudocercospora dendrobii"
464
+ expect(details(sn)).to eq [{:genus=>{:string=>"Pseudocercospora"},
465
+ :species=>{:string=>"dendrobii",
466
+ :authorship=>"(H.C. Burnett 1883) U. Braun & Crous 2003",
467
+ :combinationAuthorTeam=>{:authorTeam=>"U. Braun & Crous",
468
+ :author=>["U. Braun", "Crous"], :year=>"2003"},
469
+ :basionymAuthorTeam=>{:authorTeam=>"H.C. Burnett",
470
+ :author=>["H.C. Burnett"], :year=>"1883"}}}]
471
+ expect(pos(sn)).to eq({0=>["genus", 16], 17=>["species", 26],
472
+ 28=>["author_word", 32], 33=>["author_word", 40],
473
+ 41=>["year", 45], 47=>["author_word", 49],
474
+ 50=>["author_word", 55], 58=>["author_word", 63], 64=>["year", 68]})
475
+ end
476
+
477
+ it "parses name with subspecies without rank Zoological Code" do
305
478
  sn = "Hydnellum scrobiculatum zonatum (Banker) D. Hall & D.E. Stuntz 1972"
306
- parse(sn).should_not be_nil
307
- value(sn).should == "Hydnellum scrobiculatum zonatum (Banker) D. Hall & D.E. Stuntz 1972"
308
- canonical(sn).should == "Hydnellum scrobiculatum zonatum"
309
- details(sn).should == [{:genus=>{:string=>"Hydnellum"}, :species=>{:string=>"scrobiculatum"}, :infraspecies=>[{:string=>"zonatum", :rank=>"n/a", :authorship=>"(Banker) D. Hall & D.E. Stuntz 1972", :combinationAuthorTeam=>{:authorTeam=>"D. Hall & D.E. Stuntz", :author=>["D. Hall", "D.E. Stuntz"], :year=>"1972"}, :basionymAuthorTeam=>{:authorTeam=>"Banker", :author=>["Banker"]}}]}]
310
- pos(sn).should == {0=>["genus", 9], 10=>["species", 23], 24=>["infraspecies", 31], 33=>["author_word", 39], 41=>["author_word", 43], 44=>["author_word", 48], 51=>["author_word", 55], 56=>["author_word", 62], 63=>["year", 67]}
479
+ expect(parse(sn)).to_not be_nil
480
+ expect(value(sn)).to eq "Hydnellum scrobiculatum zonatum (Banker) "\
481
+ "D. Hall & D.E. Stuntz 1972"
482
+ expect(canonical(sn)).to eq "Hydnellum scrobiculatum zonatum"
483
+ expect(details(sn)).to eq [{:genus=>{:string=>"Hydnellum"},
484
+ :species=>{:string=>"scrobiculatum"},
485
+ :infraspecies=>[{:string=>"zonatum", :rank=>"n/a",
486
+ :authorship=>"(Banker) D. Hall & D.E. Stuntz 1972",
487
+ :combinationAuthorTeam=>{:authorTeam=>"D. Hall & D.E. Stuntz",
488
+ :author=>["D. Hall", "D.E. Stuntz"], :year=>"1972"},
489
+ :basionymAuthorTeam=>{:authorTeam=>"Banker", :author=>["Banker"]}}]}]
490
+ expect(pos(sn)).to eq({0=>["genus", 9], 10=>["species", 23],
491
+ 24=>["infraspecies", 31], 33=>["author_word", 39],
492
+ 41=>["author_word", 43], 44=>["author_word", 48],
493
+ 51=>["author_word", 55], 56=>["author_word", 62], 63=>["year", 67]})
311
494
  sn = "Begonia pingbienensis angustior"
312
- parse(sn).should_not be_nil
313
- details(sn).should == [{:genus=>{:string=>"Begonia"}, :species=>{:string=>"pingbienensis"}, :infraspecies=>[{:string=>"angustior", :rank=>"n/a"}]}]
314
- pos(sn).should == {0=>["genus", 7], 8=>["species", 21], 22=>["infraspecies", 31]}
495
+ expect(parse(sn)).to_not be_nil
496
+ expect(details(sn)).to eq [{:genus=>{:string=>"Begonia"},
497
+ :species=>{:string=>"pingbienensis"},
498
+ :infraspecies=>[{:string=>"angustior", :rank=>"n/a"}]}]
499
+ expect(pos(sn)).to eq({0=>["genus", 7],
500
+ 8=>["species", 21], 22=>["infraspecies", 31]})
315
501
  end
316
502
 
317
- it 'should parse infraspecies with rank' do
503
+ it 'parses infraspecies with rank' do
318
504
  sn = "Aus bus Linn. var. bus"
319
- parse(sn).should_not be_nil
320
- details(sn).should == [{:genus=>{:string=>"Aus"}, :species=>{:string=>"bus", :authorship=>"Linn.", :basionymAuthorTeam=>{:authorTeam=>"Linn.", :author=>["Linn."]}}, :infraspecies=>[{:string=>"bus", :rank=>"var."}]}]
505
+ expect(parse(sn)).to_not be_nil
506
+ expect(details(sn)).to eq [{:genus=>{:string=>"Aus"},
507
+ :species=>{:string=>"bus", :authorship=>"Linn.",
508
+ :basionymAuthorTeam=>{:authorTeam=>"Linn.",
509
+ :author=>["Linn."]}}, :infraspecies=>[{:string=>"bus", :rank=>"var."}]}]
321
510
  sn = "Agalinis purpurea (L.) Briton var. borealis (Berg.) Peterson 1987"
322
- parse(sn).should_not be_nil
323
- details(sn).should == [{:genus=>{:string=>"Agalinis"}, :species=>{:string=>"purpurea", :authorship=>"(L.) Briton", :combinationAuthorTeam=>{:authorTeam=>"Briton", :author=>["Briton"]}, :basionymAuthorTeam=>{:authorTeam=>"L.", :author=>["L."]}}, :infraspecies=>[{:string=>"borealis", :rank=>"var.", :authorship=>"(Berg.) Peterson 1987", :combinationAuthorTeam=>{:authorTeam=>"Peterson", :author=>["Peterson"], :year=>"1987"}, :basionymAuthorTeam=>{:authorTeam=>"Berg.", :author=>["Berg."]}}]}]
324
- pos(sn).should == {0=>["genus", 8], 9=>["species", 17], 19=>["author_word", 21], 23=>["author_word", 29], 30=>["infraspecific_type", 34], 35=>["infraspecies", 43], 45=>["author_word", 50], 52=>["author_word", 60], 61=>["year", 65]}
511
+ expect(parse(sn)).to_not be_nil
512
+ expect(details(sn)).to eq [{:genus=>{:string=>"Agalinis"},
513
+ :species=>{:string=>"purpurea", :authorship=>"(L.) Briton",
514
+ :combinationAuthorTeam=>{:authorTeam=>"Briton", :author=>["Briton"]},
515
+ :basionymAuthorTeam=>{:authorTeam=>"L.",
516
+ :author=>["L."]}}, :infraspecies=>[{:string=>"borealis",
517
+ :rank=>"var.", :authorship=>"(Berg.) Peterson 1987",
518
+ :combinationAuthorTeam=>{:authorTeam=>"Peterson",
519
+ :author=>["Peterson"], :year=>"1987"},
520
+ :basionymAuthorTeam=>{:authorTeam=>"Berg.", :author=>["Berg."]}}]}]
521
+ expect(pos(sn)).to eq({0=>["genus", 8], 9=>["species", 17],
522
+ 19=>["author_word", 21], 23=>["author_word", 29],
523
+ 30=>["infraspecific_type", 34], 35=>["infraspecies", 43],
524
+ 45=>["author_word", 50], 52=>["author_word", 60], 61=>["year", 65]})
325
525
  sn = "Phaeographis inusta var. macularis(Leight.) A.L. Sm. 1861"
326
- parse(sn).should_not be_nil
327
- value(sn).should == "Phaeographis inusta var. macularis (Leight.) A.L. Sm. 1861"
328
- canonical(sn).should == "Phaeographis inusta macularis"
329
- pos(sn).should == {0=>["genus", 12], 13=>["species", 19], 20=>["infraspecific_type", 24], 25=>["infraspecies", 34], 35=>["author_word", 42], 44=>["author_word", 48], 49=>["author_word", 52], 53=>["year", 57]}
526
+ expect(parse(sn)).to_not be_nil
527
+ expect(value(sn)).to eq "Phaeographis inusta var. macularis (Leight.) "\
528
+ "A.L. Sm. 1861"
529
+ expect(canonical(sn)).to eq "Phaeographis inusta macularis"
530
+ expect(pos(sn)).to eq({0=>["genus", 12], 13=>["species", 19],
531
+ 20=>["infraspecific_type", 24], 25=>["infraspecies", 34],
532
+ 35=>["author_word", 42], 44=>["author_word", 48],
533
+ 49=>["author_word", 52], 53=>["year", 57]})
330
534
  sn = "Cassytha peninsularis J. Z. Weber var. flindersii"
331
- canonical(sn).should == "Cassytha peninsularis flindersii"
535
+ expect(canonical(sn)).to eq "Cassytha peninsularis flindersii"
332
536
  sn = "Prunus armeniaca convar. budae (Pénzes) Soó"
333
537
 
334
- canonical(sn).should == "Prunus armeniaca budae"
538
+ expect(canonical(sn)).to eq "Prunus armeniaca budae"
335
539
  sn = "Polypodium pectinatum L. f. typica Rosenst."
336
- canonical(sn).should == "Polypodium pectinatum typica"
540
+ expect(canonical(sn)).to eq "Polypodium pectinatum typica"
337
541
  # might get confused with forma vs filius
338
542
  sn = "Polypodium pectinatum L.f. typica Rosenst."
339
- canonical(sn).should == "Polypodium pectinatum typica"
543
+ expect(canonical(sn)).to eq "Polypodium pectinatum typica"
340
544
  sn = "Polypodium pectinatum (L.) f. typica Rosenst."
341
- canonical(sn).should == "Polypodium pectinatum typica"
545
+ expect(canonical(sn)).to eq "Polypodium pectinatum typica"
342
546
  sn = "Polypodium pectinatum L. f., Rosenst."
343
- canonical(sn).should == "Polypodium pectinatum"
547
+ expect(canonical(sn)).to eq "Polypodium pectinatum"
344
548
  sn = "Polypodium pectinatum L. f."
345
- canonical(sn).should == "Polypodium pectinatum"
549
+ expect(canonical(sn)).to eq "Polypodium pectinatum"
346
550
  sn = "Polypodium pectinatum (L. f.) typica Rosent."
347
- canonical(sn).should == "Polypodium pectinatum typica"
551
+ expect(canonical(sn)).to eq "Polypodium pectinatum typica"
348
552
  sn = "Polypodium pectinatum L. f. thisisjunk Rosent."
349
- canonical(sn).should == "Polypodium pectinatum thisisjunk"
553
+ expect(canonical(sn)).to eq "Polypodium pectinatum thisisjunk"
350
554
  end
351
555
 
352
- it 'should parse unknown original authors (auct.)/(hort.)/(?)' do
556
+ it 'parsex unknown original authors (auct.)/(hort.)/(?)' do
353
557
  sn = "Tragacantha leporina (?) Kuntze"
354
- parse(sn).should_not be_nil
355
- value(sn).should == "Tragacantha leporina (?) Kuntze"
356
- details(sn).should == [{:genus=>{:string=>"Tragacantha"}, :species=>{:string=>"leporina", :authorship=>"(?) Kuntze", :combinationAuthorTeam=>{:authorTeam=>"Kuntze", :author=>["Kuntze"]}, :basionymAuthorTeam=>{:authorTeam=>"(?)", :author=>["?"]}}}]
558
+ expect(parse(sn)).to_not be_nil
559
+ expect(value(sn)).to eq "Tragacantha leporina (?) Kuntze"
560
+ expect(details(sn)).to eq [{:genus=>{:string=>"Tragacantha"},
561
+ :species=>{:string=>"leporina", :authorship=>"(?) Kuntze",
562
+ :combinationAuthorTeam=>{:authorTeam=>"Kuntze", :author=>["Kuntze"]},
563
+ :basionymAuthorTeam=>{:authorTeam=>"(?)", :author=>["?"]}}}]
357
564
  sn = "Lachenalia tricolor var. nelsonii (auct.) Baker"
358
- parse(sn).should_not be_nil
359
- value(sn).should == "Lachenalia tricolor var. nelsonii (auct.) Baker"
360
- details(sn).should == [{:genus=>{:string=>"Lachenalia"}, :species=>{:string=>"tricolor"}, :infraspecies=>[{:string=>"nelsonii", :rank=>"var.", :authorship=>"(auct.) Baker", :combinationAuthorTeam=>{:authorTeam=>"Baker", :author=>["Baker"]}, :basionymAuthorTeam=>{:authorTeam=>"auct.", :author=>["unknown"]}}]}]
361
- pos(sn).should == {0=>["genus", 10], 11=>["species", 19], 20=>["infraspecific_type", 24], 25=>["infraspecies", 33], 35=>["unknown_author", 40], 42=>["author_word", 47]}
362
- end
363
-
364
- it 'should parse unknown authors auct./anon./hort./ht.' do
565
+ expect(parse(sn)).to_not be_nil
566
+ expect(value(sn)).to eq "Lachenalia tricolor var. nelsonii (auct.) Baker"
567
+ expect(details(sn)).to eq [{:genus=>{:string=>"Lachenalia"},
568
+ :species=>{:string=>"tricolor"}, :infraspecies=>[{:string=>"nelsonii",
569
+ :rank=>"var.", :authorship=>"(auct.) Baker",
570
+ :combinationAuthorTeam=>{:authorTeam=>"Baker",
571
+ :author=>["Baker"]}, :basionymAuthorTeam=>
572
+ {:authorTeam=>"auct.", :author=>["unknown"]}}]}]
573
+ expect(pos(sn)).to eq({0=>["genus", 10], 11=>["species", 19],
574
+ 20=>["infraspecific_type", 24], 25=>["infraspecies", 33],
575
+ 35=>["unknown_author", 40], 42=>["author_word", 47]})
576
+ end
577
+
578
+ it 'parses unknown authors auct./anon./hort./ht.' do
365
579
  sn = "Puya acris ht."
366
- parse(sn).should_not be_nil
367
- pos(sn).should == {0=>["genus", 4], 5=>["species", 10], 11=>["unknown_author", 14]}
580
+ expect(parse(sn)).to_not be_nil
581
+ expect(pos(sn)).to eq({0=>["genus", 4], 5=>["species", 10],
582
+ 11=>["unknown_author", 14]})
368
583
  end
369
584
 
370
- it 'should parse normal names with hort or anon in them' do
585
+ it 'parses normal names with hort or anon in them' do
371
586
  sn = "Mus musculus hortulanus"
372
- pr = parse(sn).should_not be_nil
373
- pos(sn).should == {0=>["genus", 3], 4=>["species", 12], 13=>["infraspecies", 23]}
587
+ expect(parse(sn)).to_not be_nil
588
+ expect(pos(sn)).to eq({0=>["genus", 3], 4=>["species", 12],
589
+ 13=>["infraspecies", 23]})
374
590
  end
375
591
 
376
- it 'should parse real world examples' do
592
+ it 'parses real world examples' do
377
593
  sn = "Stagonospora polyspora M.T. Lucas & Sousa da Câmara 1934"
378
- parse(sn).should_not be_nil
379
- value(sn).should == "Stagonospora polyspora M.T. Lucas & Sousa da Câmara 1934"
380
- details(sn).should == [{:genus=>{:string=>"Stagonospora"}, :species=>{:string=>"polyspora", :authorship=>"M.T. Lucas & Sousa da Câmara 1934", :basionymAuthorTeam=>{:authorTeam=>"M.T. Lucas & Sousa da Câmara", :author=>["M.T. Lucas", "Sousa da Câmara"], :year=>"1934"}}}]
381
- pos(sn).should == {0=>["genus", 12], 13=>["species", 22], 23=>["author_word", 27], 28=>["author_word", 33], 36=>["author_word", 41], 42=>["author_word", 44], 45=>["author_word", 51], 52=>["year", 56]}
382
- parse("Cladoniicola staurospora Diederich, van den Boom & Aptroot 2001").should_not be_nil
594
+ expect(parse(sn)).to_not be_nil
595
+ expect(value(sn)).to eq "Stagonospora polyspora M.T. Lucas & Sousa da Câmara 1934"
596
+ expect(details(sn)).to eq [{:genus=>{:string=>"Stagonospora"}, :species=>{:string=>"polyspora", :authorship=>"M.T. Lucas & Sousa da Câmara 1934", :basionymAuthorTeam=>{:authorTeam=>"M.T. Lucas & Sousa da Câmara", :author=>["M.T. Lucas", "Sousa da Câmara"], :year=>"1934"}}}]
597
+ expect(pos(sn)).to eq({0=>["genus", 12], 13=>["species", 22], 23=>["author_word", 27], 28=>["author_word", 33], 36=>["author_word", 41], 42=>["author_word", 44], 45=>["author_word", 51], 52=>["year", 56]})
598
+ expect(parse("Cladoniicola staurospora Diederich, van den Boom & Aptroot 2001")).to_not be_nil
383
599
  sn = "Yarrowia lipolytica var. lipolytica (Wick., Kurtzman & E.A. Herrm.) Van der Walt & Arx 1981"
384
- parse(sn).should_not be_nil
385
- value(sn).should == "Yarrowia lipolytica var. lipolytica (Wick., Kurtzman & E.A. Herrm.) Van der Walt & Arx 1981"
386
- pos(sn).should == {0=>["genus", 8], 9=>["species", 19], 20=>["infraspecific_type", 24], 25=>["infraspecies", 35], 37=>["author_word", 42], 44=>["author_word", 52], 55=>["author_word", 59], 60=>["author_word", 66], 68=>["author_word", 71], 72=>["author_word", 75], 76=>["author_word", 80], 83=>["author_word", 86], 87=>["year", 91]}
387
- parse("Physalospora rubiginosa (Fr.) anon.").should_not be_nil
388
- parse("Pleurotus ëous (Berk.) Sacc. 1887").should_not be_nil
389
- parse("Lecanora wetmorei Śliwa 2004").should_not be_nil
600
+ expect(parse(sn)).to_not be_nil
601
+ expect(value(sn)).to eq "Yarrowia lipolytica var. lipolytica (Wick., Kurtzman & E.A. Herrm.) Van der Walt & Arx 1981"
602
+ expect(pos(sn)).to eq({0=>["genus", 8], 9=>["species", 19], 20=>["infraspecific_type", 24], 25=>["infraspecies", 35], 37=>["author_word", 42], 44=>["author_word", 52], 55=>["author_word", 59], 60=>["author_word", 66], 68=>["author_word", 71], 72=>["author_word", 75], 76=>["author_word", 80], 83=>["author_word", 86], 87=>["year", 91]})
603
+ expect(parse("Physalospora rubiginosa (Fr.) anon.")).to_not be_nil
604
+ expect(parse("Pleurotus ëous (Berk.) Sacc. 1887")).to_not be_nil
605
+ expect(parse("Lecanora wetmorei Śliwa 2004")).to_not be_nil
390
606
  # valid
391
607
  # infraspecific
392
- parse("Calicium furfuraceum * furfuraceum (L.) Pers. 1797").should_not be_nil
393
- parse("Exobasidium vaccinii ** andromedae (P. Karst.) P. Karst. 1882").should_not be_nil
394
- parse("Urceolaria scruposa **** clausa Flot. 1849").should_not be_nil
395
- parse("Cortinarius angulatus B gracilescens Fr. 1838").should_not be_nil
396
- parse("Cyathicula scelobelonium").should_not be_nil
608
+ expect(parse("Calicium furfuraceum * furfuraceum (L.) Pers. 1797")).to_not be_nil
609
+ expect(parse("Exobasidium vaccinii ** andromedae (P. Karst.) P. Karst. 1882")).to_not be_nil
610
+ expect(parse("Urceolaria scruposa **** clausa Flot. 1849")).to_not be_nil
611
+ expect(parse("Cortinarius angulatus B gracilescens Fr. 1838")).to_not be_nil
612
+ expect(parse("Cyathicula scelobelonium")).to_not be_nil
397
613
  # single quote that did not show
398
614
  # parse("Phytophthora hedraiandra De Cock & Man in ?t Veld 2004"
399
615
  # Phthora vastatrix d?Hérelle 1909
400
616
  # author is exception
401
617
  sn = "Tuber liui A S. Xu 1999"
402
- parse(sn).should_not be_nil
403
- details(sn).should == [{:genus=>{:string=>"Tuber"}, :species=>{:string=>"liui", :authorship=>"A S. Xu 1999", :basionymAuthorTeam=>{:authorTeam=>"A S. Xu", :author=>["A S. Xu"], :year=>"1999"}}}]
404
- parse('Xylaria potentillae A S. Xu').should_not be_nil
405
- parse("Agaricus squamula Berk. & M.A. Curtis 1860").should_not be_nil
406
- parse("Peltula coriacea Büdel, Henssen & Wessels 1986").should_not be_nil
618
+ expect(parse(sn)).to_not be_nil
619
+ expect(details(sn)).to eq [{:genus=>{:string=>"Tuber"}, :species=>{:string=>"liui", :authorship=>"A S. Xu 1999", :basionymAuthorTeam=>{:authorTeam=>"A S. Xu", :author=>["A S. Xu"], :year=>"1999"}}}]
620
+ expect(parse('Xylaria potentillae A S. Xu')).to_not be_nil
621
+ expect(parse("Agaricus squamula Berk. & M.A. Curtis 1860")).to_not be_nil
622
+ expect(parse("Peltula coriacea Büdel, Henssen & Wessels 1986")).to_not be_nil
407
623
  #had to add no dot rule for trinomials without a rank to make it to work
408
624
  sn = "Saccharomyces drosophilae anon."
409
- parse(sn).should_not be_nil
410
- details(sn).should == [{:genus=>{:string=>"Saccharomyces"}, :species=>{:string=>"drosophilae", :authorship=>"anon.", :basionymAuthorTeam=>{:authorTeam=>"anon.", :author=>["unknown"]}}}]
411
- pos(sn).should == {0=>["genus", 13], 14=>["species", 25], 26=>["unknown_author", 31]}
625
+ expect(parse(sn)).to_not be_nil
626
+ expect(details(sn)).to eq [{:genus=>{:string=>"Saccharomyces"}, :species=>{:string=>"drosophilae", :authorship=>"anon.", :basionymAuthorTeam=>{:authorTeam=>"anon.", :author=>["unknown"]}}}]
627
+ expect(pos(sn)).to eq({0=>["genus", 13], 14=>["species", 25], 26=>["unknown_author", 31]})
412
628
  sn = "Abacetus laevicollis de Chaudoir, 1869"
413
- parse(sn).should_not be_nil
414
- canonical(sn).should == 'Abacetus laevicollis'
629
+ expect(parse(sn)).to_not be_nil
630
+ expect(canonical(sn)).to eq 'Abacetus laevicollis'
415
631
  sn = "Gastrosericus eremorum van Beaumont 1955"
416
- canonical(sn).should == 'Gastrosericus eremorum'
632
+ expect(canonical(sn)).to eq 'Gastrosericus eremorum'
417
633
  sn = "Gastrosericus eremorum von Beaumont 1955"
418
- canonical(sn).should == 'Gastrosericus eremorum'
634
+ expect(canonical(sn)).to eq 'Gastrosericus eremorum'
419
635
  sn = "Cypraeovula (Luponia) amphithales perdentata"
420
- canonical(sn).should == 'Cypraeovula amphithales perdentata'
421
- details(sn).should == [{:genus=>{:string=>"Cypraeovula"}, :infragenus=>{:string=>"Luponia"}, :species=>{:string=>"amphithales"}, :infraspecies=>[{:string=>"perdentata", :rank=>"n/a"}]}]
636
+ expect(canonical(sn)).to eq 'Cypraeovula amphithales perdentata'
637
+ expect(details(sn)).to eq [{:genus=>{:string=>"Cypraeovula"}, :infragenus=>{:string=>"Luponia"}, :species=>{:string=>"amphithales"}, :infraspecies=>[{:string=>"perdentata", :rank=>"n/a"}]}]
422
638
  sn = "Polyrhachis orsyllus nat musculus Forel 1901"
423
- canonical(sn).should == "Polyrhachis orsyllus musculus"
639
+ expect(canonical(sn)).to eq "Polyrhachis orsyllus musculus"
424
640
  sn = 'Latrodectus 13-guttatus Thorell, 1875'
425
- canonical(sn).should == 'Latrodectus tredecguttatus'
426
- value(sn).should == 'Latrodectus tredecguttatus Thorell 1875'
641
+ expect(canonical(sn)).to eq 'Latrodectus tredecguttatus'
642
+ expect(value(sn)).to eq 'Latrodectus tredecguttatus Thorell 1875'
427
643
  sn = 'Latrodectus 3-guttatus Thorell, 1875'
428
- canonical(sn).should == 'Latrodectus triguttatus'
429
- value(sn).should == 'Latrodectus triguttatus Thorell 1875'
644
+ expect(canonical(sn)).to eq 'Latrodectus triguttatus'
645
+ expect(value(sn)).to eq 'Latrodectus triguttatus Thorell 1875'
430
646
  sn = 'Balaninus c-album Schönherr, CJ., 1836'
431
- canonical(sn).should == 'Balaninus c-album'
647
+ expect(canonical(sn)).to eq 'Balaninus c-album'
432
648
  end
433
649
 
434
- it "should parse name with morph." do
650
+ it "parses name with morph." do
435
651
  sn = "Callideriphus flavicollis morph. reductus Fuchs 1961"
436
- parse(sn).should_not be_nil
437
- value(sn).should == "Callideriphus flavicollis morph. reductus Fuchs 1961"
438
- canonical(sn).should == "Callideriphus flavicollis reductus"
439
- details(sn).should == [{:genus=>{:string=>"Callideriphus"}, :species=>{:string=>"flavicollis"}, :infraspecies=>[{:string=>"reductus", :rank=>"morph.", :authorship=>"Fuchs 1961", :basionymAuthorTeam=>{:authorTeam=>"Fuchs", :author=>["Fuchs"], :year=>"1961"}}]}]
440
- pos(sn).should == {0=>["genus", 13], 14=>["species", 25], 26=>["infraspecific_type", 32], 33=>["infraspecies", 41], 42=>["author_word", 47], 48=>["year", 52]}
652
+ expect(parse(sn)).to_not be_nil
653
+ expect(value(sn)).to eq "Callideriphus flavicollis morph. reductus Fuchs 1961"
654
+ expect(canonical(sn)).to eq "Callideriphus flavicollis reductus"
655
+ expect(details(sn)).to eq [{:genus=>{:string=>"Callideriphus"}, :species=>{:string=>"flavicollis"}, :infraspecies=>[{:string=>"reductus", :rank=>"morph.", :authorship=>"Fuchs 1961", :basionymAuthorTeam=>{:authorTeam=>"Fuchs", :author=>["Fuchs"], :year=>"1961"}}]}]
656
+ expect(pos(sn)).to eq({0=>["genus", 13], 14=>["species", 25], 26=>["infraspecific_type", 32], 33=>["infraspecies", 41], 42=>["author_word", 47], 48=>["year", 52]})
441
657
  end
442
658
 
443
659
 
444
- it "should parse name with forma/fo./form./f." do
660
+ it "parses name with forma/fo./form./f." do
445
661
  sn = "Caulerpa cupressoides forma nuda"
446
- parse(sn).should_not be_nil
447
- value(sn).should == "Caulerpa cupressoides forma nuda"
448
- canonical(sn).should == "Caulerpa cupressoides nuda"
449
- details(sn).should == [{:genus=>{:string=>"Caulerpa"}, :species=>{:string=>"cupressoides"}, :infraspecies=>[{:string=>"nuda", :rank=>"forma"}]}]
450
- pos(sn).should == {0=>["genus", 8], 9=>["species", 21], 22=>["infraspecific_type", 27], 28=>["infraspecies", 32]}
662
+ expect(parse(sn)).to_not be_nil
663
+ expect(value(sn)).to eq "Caulerpa cupressoides forma nuda"
664
+ expect(canonical(sn)).to eq "Caulerpa cupressoides nuda"
665
+ expect(details(sn)).to eq [{:genus=>{:string=>"Caulerpa"}, :species=>{:string=>"cupressoides"}, :infraspecies=>[{:string=>"nuda", :rank=>"forma"}]}]
666
+ expect(pos(sn)).to eq({0=>["genus", 8], 9=>["species", 21], 22=>["infraspecific_type", 27], 28=>["infraspecies", 32]})
451
667
  sn = "Chlorocyperus glaber form. fasciculariforme (Lojac.) Soó"
452
- parse(sn).should_not be_nil
453
- value("Chlorocyperus glaber form. fasciculariforme (Lojac.) Soó").should == "Chlorocyperus glaber form. fasciculariforme (Lojac.) Soó"
454
- canonical(sn).should == "Chlorocyperus glaber fasciculariforme"
455
- details(sn).should == [{:genus=>{:string=>"Chlorocyperus"}, :species=>{:string=>"glaber"}, :infraspecies=>[{:string=>"fasciculariforme", :rank=>"form.", :authorship=>"(Lojac.) Soó", :combinationAuthorTeam=>{:authorTeam=>"Soó", :author=>["Soó"]}, :basionymAuthorTeam=>{:authorTeam=>"Lojac.", :author=>["Lojac."]}}]}]
456
- pos(sn).should == {0=>["genus", 13], 14=>["species", 20], 21=>["infraspecific_type", 26], 27=>["infraspecies", 43], 45=>["author_word", 51], 53=>["author_word", 56]}
668
+ expect(parse(sn)).to_not be_nil
669
+ expect(value("Chlorocyperus glaber form. fasciculariforme (Lojac.) Soó")).to eq "Chlorocyperus glaber form. fasciculariforme (Lojac.) Soó"
670
+ expect(canonical(sn)).to eq "Chlorocyperus glaber fasciculariforme"
671
+ expect(details(sn)).to eq [{:genus=>{:string=>"Chlorocyperus"}, :species=>{:string=>"glaber"}, :infraspecies=>[{:string=>"fasciculariforme", :rank=>"form.", :authorship=>"(Lojac.) Soó", :combinationAuthorTeam=>{:authorTeam=>"Soó", :author=>["Soó"]}, :basionymAuthorTeam=>{:authorTeam=>"Lojac.", :author=>["Lojac."]}}]}]
672
+ expect(pos(sn)).to eq({0=>["genus", 13], 14=>["species", 20], 21=>["infraspecific_type", 26], 27=>["infraspecies", 43], 45=>["author_word", 51], 53=>["author_word", 56]})
457
673
  sn = "Bambusa nana Roxb. fo. alphonse-karri (Mitford ex Satow) Makino ex Shiros."
458
- parse(sn).should_not be_nil
459
- value(sn).should == "Bambusa nana Roxb. fo. alphonse-karri (Mitford ex Satow) Makino ex Shiros."
460
- canonical(sn).should == "Bambusa nana alphonse-karri"
461
- details(sn).should == [{:genus=>{:string=>"Bambusa"}, :species=>{:string=>"nana", :authorship=>"Roxb.", :basionymAuthorTeam=>{:authorTeam=>"Roxb.", :author=>["Roxb."]}}, :infraspecies=>[{:string=>"alphonse-karri", :rank=>"fo.", :authorship=>"(Mitford ex Satow) Makino ex Shiros.", :combinationAuthorTeam=>{:authorTeam=>"Makino", :author=>["Makino"], :exAuthorTeam=>{:authorTeam=>"Shiros.", :author=>["Shiros."]}}, :basionymAuthorTeam=>{:authorTeam=>"Mitford", :author=>["Mitford"], :exAuthorTeam=>{:authorTeam=>"Satow", :author=>["Satow"]}}}]}]
462
- pos(sn).should == {0=>["genus", 7], 8=>["species", 12], 13=>["author_word", 18], 19=>["infraspecific_type", 22], 23=>["infraspecies", 37], 39=>["author_word", 46], 50=>["author_word", 55], 57=>["author_word", 63], 67=>["author_word", 74]}
674
+ expect(parse(sn)).to_not be_nil
675
+ expect(value(sn)).to eq "Bambusa nana Roxb. fo. alphonse-karri (Mitford ex Satow) Makino ex Shiros."
676
+ expect(canonical(sn)).to eq "Bambusa nana alphonse-karri"
677
+ expect(details(sn)).to eq [{:genus=>{:string=>"Bambusa"}, :species=>{:string=>"nana", :authorship=>"Roxb.", :basionymAuthorTeam=>{:authorTeam=>"Roxb.", :author=>["Roxb."]}}, :infraspecies=>[{:string=>"alphonse-karri", :rank=>"fo.", :authorship=>"(Mitford ex Satow) Makino ex Shiros.", :combinationAuthorTeam=>{:authorTeam=>"Makino", :author=>["Makino"], :exAuthorTeam=>{:authorTeam=>"Shiros.", :author=>["Shiros."]}}, :basionymAuthorTeam=>{:authorTeam=>"Mitford", :author=>["Mitford"], :exAuthorTeam=>{:authorTeam=>"Satow", :author=>["Satow"]}}}]}]
678
+ expect(pos(sn)).to eq({0=>["genus", 7], 8=>["species", 12], 13=>["author_word", 18], 19=>["infraspecific_type", 22], 23=>["infraspecies", 37], 39=>["author_word", 46], 50=>["author_word", 55], 57=>["author_word", 63], 67=>["author_word", 74]})
463
679
  sn = " Sphaerotheca fuliginea f. dahliae Movss. 1967 "
464
680
  sn = "Sphaerotheca fuliginea f. dahliae Movss. 1967"
465
- parse(sn).should_not be_nil
466
- value(sn).should == "Sphaerotheca fuliginea f. dahliae Movss. 1967"
467
- canonical(sn).should == "Sphaerotheca fuliginea dahliae"
468
- details(sn).should == [{:genus=>{:string=>"Sphaerotheca"}, :species=>{:string=>"fuliginea"}, :infraspecies=>[{:string=>"dahliae", :rank=>"f.", :authorship=>"Movss. 1967", :basionymAuthorTeam=>{:authorTeam=>"Movss.", :author=>["Movss."], :year=>"1967"}}]}]
469
- pos(sn).should == {0=>["genus", 12], 16=>["species", 25], 29=>["infraspecific_type", 31], 36=>["infraspecies", 43], 47=>["author_word", 53], 58=>["year", 62]}
470
- parse('Polypodium vulgare nothosubsp. mantoniae (Rothm.) Schidlay').should_not be_nil
681
+ expect(parse(sn)).to_not be_nil
682
+ expect(value(sn)).to eq "Sphaerotheca fuliginea f. dahliae Movss. 1967"
683
+ expect(canonical(sn)).to eq "Sphaerotheca fuliginea dahliae"
684
+ expect(details(sn)).to eq [{:genus=>{:string=>"Sphaerotheca"}, :species=>{:string=>"fuliginea"}, :infraspecies=>[{:string=>"dahliae", :rank=>"f.", :authorship=>"Movss. 1967", :basionymAuthorTeam=>{:authorTeam=>"Movss.", :author=>["Movss."], :year=>"1967"}}]}]
685
+ expect(pos(sn)).to eq({0=>["genus", 12], 16=>["species", 25], 29=>["infraspecific_type", 31], 36=>["infraspecies", 43], 47=>["author_word", 53], 58=>["year", 62]})
686
+ expect(parse('Polypodium vulgare nothosubsp. mantoniae (Rothm.) Schidlay')).to_not be_nil
471
687
  end
472
688
 
473
- it "should parse name with several subspecies names NOT BOTANICAL CODE BUT NOT INFREQUENT" do
689
+ it "parses name with several subspecies names NOT BOTANICAL CODE BUT NOT INFREQUENT" do
474
690
  sn = "Hydnellum scrobiculatum var. zonatum f. parvum (Banker) D. Hall & D.E. Stuntz 1972"
475
- parse(sn).should_not be_nil
476
- value(sn).should == "Hydnellum scrobiculatum var. zonatum f. parvum (Banker) D. Hall & D.E. Stuntz 1972"
477
- details(sn).should == [{:genus=>{:string=>"Hydnellum"}, :species=>{:string=>"scrobiculatum"}, :infraspecies=>[{:string=>"zonatum", :rank=>"var."}, {:string=>"parvum", :rank=>"f.", :authorship=>"(Banker) D. Hall & D.E. Stuntz 1972", :combinationAuthorTeam=>{:authorTeam=>"D. Hall & D.E. Stuntz", :author=>["D. Hall", "D.E. Stuntz"], :year=>"1972"}, :basionymAuthorTeam=>{:authorTeam=>"Banker", :author=>["Banker"]}}]}]
478
- pos(sn).should == {0=>["genus", 9], 10=>["species", 23], 24=>["infraspecific_type", 28], 29=>["infraspecies", 36], 37=>["infraspecific_type", 39], 40=>["infraspecies", 46], 48=>["author_word", 54], 56=>["author_word", 58], 59=>["author_word", 63], 66=>["author_word", 70], 71=>["author_word", 77], 78=>["year", 82]}
479
- parse('Senecio fuchsii C.C.Gmel. subsp. fuchsii var. expansus (Boiss. & Heldr.) Hayek').should_not be_nil
480
- parse('Senecio fuchsii C.C.Gmel. subsp. fuchsii var. fuchsii').should_not be_nil
691
+ expect(parse(sn)).to_not be_nil
692
+ expect(value(sn)).to eq "Hydnellum scrobiculatum var. zonatum f. parvum (Banker) D. Hall & D.E. Stuntz 1972"
693
+ expect(details(sn)).to eq [{:genus=>{:string=>"Hydnellum"}, :species=>{:string=>"scrobiculatum"}, :infraspecies=>[{:string=>"zonatum", :rank=>"var."}, {:string=>"parvum", :rank=>"f.", :authorship=>"(Banker) D. Hall & D.E. Stuntz 1972", :combinationAuthorTeam=>{:authorTeam=>"D. Hall & D.E. Stuntz", :author=>["D. Hall", "D.E. Stuntz"], :year=>"1972"}, :basionymAuthorTeam=>{:authorTeam=>"Banker", :author=>["Banker"]}}]}]
694
+ expect(pos(sn)).to eq({0=>["genus", 9], 10=>["species", 23], 24=>["infraspecific_type", 28], 29=>["infraspecies", 36], 37=>["infraspecific_type", 39], 40=>["infraspecies", 46], 48=>["author_word", 54], 56=>["author_word", 58], 59=>["author_word", 63], 66=>["author_word", 70], 71=>["author_word", 77], 78=>["year", 82]})
695
+ expect(parse('Senecio fuchsii C.C.Gmel. subsp. fuchsii var. expansus (Boiss. & Heldr.) Hayek')).to_not be_nil
696
+ expect(parse('Senecio fuchsii C.C.Gmel. subsp. fuchsii var. fuchsii')).to_not be_nil
481
697
  end
482
698
 
483
699
 
484
- it "should parse status BOTANICAL RARE" do
700
+ it "parses status BOTANICAL RARE" do
485
701
  #it is always latin abbrev often 2 words
486
702
  sn = "Arthopyrenia hyalospora (Nyl.) R.C. Harris comb. nov."
487
- parse(sn).should_not be_nil
488
- value(sn).should == "Arthopyrenia hyalospora (Nyl.) R.C. Harris comb. nov."
489
- canonical(sn).should == "Arthopyrenia hyalospora"
490
- details(sn).should == [{:genus=>{:string=>"Arthopyrenia"}, :species=>{:string=>"hyalospora", :authorship=>"(Nyl.) R.C. Harris", :combinationAuthorTeam=>{:authorTeam=>"R.C. Harris", :author=>["R.C. Harris"]}, :basionymAuthorTeam=>{:authorTeam=>"Nyl.", :author=>["Nyl."]}}, :status=>"comb. nov."}]
491
- pos(sn).should == {0=>["genus", 12], 13=>["species", 23], 25=>["author_word", 29], 31=>["author_word", 35], 36=>["author_word", 42]}
703
+ expect(parse(sn)).to_not be_nil
704
+ expect(value(sn)).to eq "Arthopyrenia hyalospora (Nyl.) R.C. Harris comb. nov."
705
+ expect(canonical(sn)).to eq "Arthopyrenia hyalospora"
706
+ expect(details(sn)).to eq [{:genus=>{:string=>"Arthopyrenia"}, :species=>{:string=>"hyalospora", :authorship=>"(Nyl.) R.C. Harris", :combinationAuthorTeam=>{:authorTeam=>"R.C. Harris", :author=>["R.C. Harris"]}, :basionymAuthorTeam=>{:authorTeam=>"Nyl.", :author=>["Nyl."]}}, :status=>"comb. nov."}]
707
+ expect(pos(sn)).to eq({0=>["genus", 12], 13=>["species", 23], 25=>["author_word", 29], 31=>["author_word", 35], 36=>["author_word", 42]})
492
708
  end
493
709
 
494
- it "should parse revised (ex) names" do
710
+ it "parses revised (ex) names" do
495
711
  #invalidly published
496
712
  sn = "Arthopyrenia hyalospora (Nyl. ex Banker) R.C. Harris"
497
- parse(sn).should_not be_nil
498
- value(sn).should == "Arthopyrenia hyalospora (Nyl. ex Banker) R.C. Harris"
499
- canonical(sn).should == "Arthopyrenia hyalospora"
500
- details(sn).should == [{:genus=>{:string=>"Arthopyrenia"}, :species=>{:string=>"hyalospora", :authorship=>"(Nyl. ex Banker) R.C. Harris", :combinationAuthorTeam=>{:authorTeam=>"R.C. Harris", :author=>["R.C. Harris"]}, :basionymAuthorTeam=>{:authorTeam=>"Nyl.", :author=>["Nyl."], :exAuthorTeam=>{:authorTeam=>"Banker", :author=>["Banker"]}}}}]
501
- pos(sn).should == {0=>["genus", 12], 13=>["species", 23], 25=>["author_word", 29], 33=>["author_word", 39], 41=>["author_word", 45], 46=>["author_word", 52]}
713
+ expect(parse(sn)).to_not be_nil
714
+ expect(value(sn)).to eq "Arthopyrenia hyalospora (Nyl. ex Banker) R.C. Harris"
715
+ expect(canonical(sn)).to eq "Arthopyrenia hyalospora"
716
+ expect(details(sn)).to eq [{:genus=>{:string=>"Arthopyrenia"}, :species=>{:string=>"hyalospora", :authorship=>"(Nyl. ex Banker) R.C. Harris", :combinationAuthorTeam=>{:authorTeam=>"R.C. Harris", :author=>["R.C. Harris"]}, :basionymAuthorTeam=>{:authorTeam=>"Nyl.", :author=>["Nyl."], :exAuthorTeam=>{:authorTeam=>"Banker", :author=>["Banker"]}}}}]
717
+ expect(pos(sn)).to eq({0=>["genus", 12], 13=>["species", 23], 25=>["author_word", 29], 33=>["author_word", 39], 41=>["author_word", 45], 46=>["author_word", 52]})
502
718
  sn = "Arthopyrenia hyalospora Nyl. ex Banker"
503
- parse(sn).should_not be_nil
504
- details(sn).should == [{:genus=>{:string=>"Arthopyrenia"}, :species=>{:string=>"hyalospora", :authorship=>"Nyl. ex Banker", :basionymAuthorTeam=>{:authorTeam=>"Nyl.", :author=>["Nyl."], :exAuthorTeam=>{:authorTeam=>"Banker", :author=>["Banker"]}}}}]
719
+ expect(parse(sn)).to_not be_nil
720
+ expect(details(sn)).to eq [{:genus=>{:string=>"Arthopyrenia"}, :species=>{:string=>"hyalospora", :authorship=>"Nyl. ex Banker", :basionymAuthorTeam=>{:authorTeam=>"Nyl.", :author=>["Nyl."], :exAuthorTeam=>{:authorTeam=>"Banker", :author=>["Banker"]}}}}]
505
721
  sn = "Glomopsis lonicerae Peck ex C.J. Gould 1945"
506
- parse(sn).should_not be_nil
507
- details(sn).should == [{:genus=>{:string=>"Glomopsis"}, :species=>{:string=>"lonicerae", :authorship=>"Peck ex C.J. Gould 1945", :basionymAuthorTeam=>{:authorTeam=>"Peck", :author=>["Peck"], :exAuthorTeam=>{:authorTeam=>"C.J. Gould", :author=>["C.J. Gould"], :year=>"1945"}}}}]
508
- pos(sn).should == {0=>["genus", 9], 10=>["species", 19], 20=>["author_word", 24], 28=>["author_word", 32], 33=>["author_word", 38], 39=>["year", 43]}
509
- parse("Acanthobasidium delicatum (Wakef.) Oberw. ex Jülich 1979").should_not be_nil
722
+ expect(parse(sn)).to_not be_nil
723
+ expect(details(sn)).to eq [{:genus=>{:string=>"Glomopsis"}, :species=>{:string=>"lonicerae", :authorship=>"Peck ex C.J. Gould 1945", :basionymAuthorTeam=>{:authorTeam=>"Peck", :author=>["Peck"], :exAuthorTeam=>{:authorTeam=>"C.J. Gould", :author=>["C.J. Gould"], :year=>"1945"}}}}]
724
+ expect(pos(sn)).to eq({0=>["genus", 9], 10=>["species", 19], 20=>["author_word", 24], 28=>["author_word", 32], 33=>["author_word", 38], 39=>["year", 43]})
725
+ expect(parse("Acanthobasidium delicatum (Wakef.) Oberw. ex Jülich 1979")).to_not be_nil
510
726
  sn = "Mycosphaerella eryngii (Fr. ex Duby) Johanson ex Oudem. 1897"
511
- parse(sn).should_not be_nil
512
- details(sn).should == [{:genus=>{:string=>"Mycosphaerella"}, :species=>{:string=>"eryngii", :authorship=>"(Fr. ex Duby) Johanson ex Oudem. 1897", :combinationAuthorTeam=>{:authorTeam=>"Johanson", :author=>["Johanson"], :exAuthorTeam=>{:authorTeam=>"Oudem.", :author=>["Oudem."], :year=>"1897"}}, :basionymAuthorTeam=>{:authorTeam=>"Fr.", :author=>["Fr."], :exAuthorTeam=>{:authorTeam=>"Duby", :author=>["Duby"]}}}}]
513
- pos(sn).should == {0=>["genus", 14], 15=>["species", 22], 24=>["author_word", 27], 31=>["author_word", 35], 37=>["author_word", 45], 49=>["author_word", 55], 56=>["year", 60]}
727
+ expect(parse(sn)).to_not be_nil
728
+ expect(details(sn)).to eq [{:genus=>{:string=>"Mycosphaerella"}, :species=>{:string=>"eryngii", :authorship=>"(Fr. ex Duby) Johanson ex Oudem. 1897", :combinationAuthorTeam=>{:authorTeam=>"Johanson", :author=>["Johanson"], :exAuthorTeam=>{:authorTeam=>"Oudem.", :author=>["Oudem."], :year=>"1897"}}, :basionymAuthorTeam=>{:authorTeam=>"Fr.", :author=>["Fr."], :exAuthorTeam=>{:authorTeam=>"Duby", :author=>["Duby"]}}}}]
729
+ expect(pos(sn)).to eq({0=>["genus", 14], 15=>["species", 22], 24=>["author_word", 27], 31=>["author_word", 35], 37=>["author_word", 45], 49=>["author_word", 55], 56=>["year", 60]})
514
730
  #invalid but happens
515
- parse("Mycosphaerella eryngii (Fr. Duby) ex Oudem. 1897").should_not be_nil
516
- parse("Mycosphaerella eryngii (Fr.ex Duby) ex Oudem. 1897").should_not be_nil
731
+ expect(parse("Mycosphaerella eryngii (Fr. Duby) ex Oudem. 1897")).to_not be_nil
732
+ expect(parse("Mycosphaerella eryngii (Fr.ex Duby) ex Oudem. 1897")).to_not be_nil
517
733
  sn = "Salmonella werahensis (Castellani) Hauduroy and Ehringer in Hauduroy 1937"
518
- parse(sn).should_not be_nil
519
- details(sn).should == [{:genus=>{:string=>"Salmonella"}, :species=>{:string=>"werahensis", :authorship=>"(Castellani) Hauduroy and Ehringer in Hauduroy 1937", :combinationAuthorTeam=>{:authorTeam=>"Hauduroy and Ehringer", :author=>["Hauduroy", "Ehringer"], :exAuthorTeam=>{:authorTeam=>"Hauduroy", :author=>["Hauduroy"], :year=>"1937"}}, :basionymAuthorTeam=>{:authorTeam=>"Castellani", :author=>["Castellani"]}}}]
520
- pos(sn).should == {0=>["genus", 10], 11=>["species", 21], 23=>["author_word", 33], 35=>["author_word", 43], 48=>["author_word", 56], 60=>["author_word", 68], 69=>["year", 73]}
734
+ expect(parse(sn)).to_not be_nil
735
+ expect(details(sn)).to eq [{:genus=>{:string=>"Salmonella"}, :species=>{:string=>"werahensis", :authorship=>"(Castellani) Hauduroy and Ehringer in Hauduroy 1937", :combinationAuthorTeam=>{:authorTeam=>"Hauduroy and Ehringer", :author=>["Hauduroy", "Ehringer"], :exAuthorTeam=>{:authorTeam=>"Hauduroy", :author=>["Hauduroy"], :year=>"1937"}}, :basionymAuthorTeam=>{:authorTeam=>"Castellani", :author=>["Castellani"]}}}]
736
+ expect(pos(sn)).to eq({0=>["genus", 10], 11=>["species", 21], 23=>["author_word", 33], 35=>["author_word", 43], 48=>["author_word", 56], 60=>["author_word", 68], 69=>["year", 73]})
521
737
  end
522
738
 
523
- it 'should parse named hybrids' do
739
+ it 'parses named hybrids' do
524
740
  [
525
741
  ["×Agropogon P. Fourn. 1934", [{:uninomial=>{:string=>"Agropogon", :authorship=>"P. Fourn. 1934", :basionymAuthorTeam=>{:authorTeam=>"P. Fourn.", :author=>["P. Fourn."], :year=>"1934"}}}]],
526
742
  ["xAgropogon P. Fourn.", [{:uninomial=>{:string=>"Agropogon", :authorship=>"P. Fourn.", :basionymAuthorTeam=>{:authorTeam=>"P. Fourn.", :author=>["P. Fourn."]}}}]],
@@ -534,9 +750,9 @@ describe ScientificNameClean do
534
750
  ["x Heucherella tiarelloides", [{:genus=>{:string=>"Heucherella"}, :species=>{:string=>"tiarelloides"}}]],
535
751
  ["×Agropogon littoralis (Sm.) C. E. Hubb. 1946", [{:genus=>{:string=>"Agropogon"}, :species=>{:string=>"littoralis", :authorship=>"(Sm.) C. E. Hubb. 1946", :combinationAuthorTeam=>{:authorTeam=>"C. E. Hubb.", :author=>["C. E. Hubb."], :year=>"1946"}, :basionymAuthorTeam=>{:authorTeam=>"Sm.", :author=>["Sm."]}}}]]
536
752
  ].each do |res|
537
- parse(res[0]).should_not be_nil
538
- parse(res[0]).hybrid.should be_true
539
- details(res[0]).should == res[1]
753
+ expect(parse(res[0])).to_not be_nil
754
+ expect(parse(res[0]).hybrid).to eq true
755
+ expect(details(res[0])).to eq res[1]
540
756
  end
541
757
  [
542
758
  ['Asplenium X inexpectatum (E.L. Braun 1940) Morton (1956)',[{:genus=>{:string=>"Asplenium"}, :species=>{:string=>"inexpectatum", :authorship=>"(E.L. Braun 1940) Morton (1956)", :combinationAuthorTeam=>{:authorTeam=>"Morton", :author=>["Morton"], :year=>"1956"}, :basionymAuthorTeam=>{:authorTeam=>"E.L. Braun", :author=>["E.L. Braun"], :year=>"1940"}}}]],
@@ -544,116 +760,116 @@ describe ScientificNameClean do
544
760
  ['Salix ×capreola Andersson (1867)',[{:genus=>{:string=>"Salix"}, :species=>{:string=>"capreola", :authorship=>"Andersson (1867)", :basionymAuthorTeam=>{:authorTeam=>"Andersson", :author=>["Andersson"], :year=>"1867"}}}]],
545
761
  ['Salix x capreola Andersson',[{:genus=>{:string=>"Salix"}, :species=>{:string=>"capreola", :authorship=>"Andersson", :basionymAuthorTeam=>{:authorTeam=>"Andersson", :author=>["Andersson"]}}}]]
546
762
  ].each do |res|
547
- parse(res[0]).should_not be_nil
548
- parse(res[0]).hybrid.should be_true
549
- details(res[0]).should == res[1]
763
+ expect(parse(res[0])).to_not be_nil
764
+ expect(parse(res[0]).hybrid).to eq true
765
+ expect(details(res[0])).to eq res[1]
550
766
  end
551
767
  sn = "Rosa alpina x pomifera"
552
- canonical(sn).should == "Rosa alpina × pomifera"
553
- parse(sn).details.should == [{:genus=>{:string=>"Rosa"}, :species=>{:string=>"alpina"}}, {:species=>{:string=>"pomifera"}, :genus=>{:string=>"Rosa"}}]
768
+ expect(canonical(sn)).to eq "Rosa alpina × pomifera"
769
+ expect(parse(sn).details).to eq [{:genus=>{:string=>"Rosa"}, :species=>{:string=>"alpina"}}, {:species=>{:string=>"pomifera"}, :genus=>{:string=>"Rosa"}}]
554
770
  end
555
771
 
556
- it "should parse hybrid combination" do
772
+ it "parses hybrid combination" do
557
773
  sn = "Arthopyrenia hyalospora X Hydnellum scrobiculatum"
558
- parse(sn).should_not be_nil
559
- parse(sn).hybrid.should be_true
560
- value(sn).should == "Arthopyrenia hyalospora \303\227 Hydnellum scrobiculatum"
561
- canonical(sn).should == "Arthopyrenia hyalospora × Hydnellum scrobiculatum"
562
- details(sn).should == [{:genus=>{:string=>"Arthopyrenia"}, :species=>{:string=>"hyalospora"}}, {:genus=>{:string=>"Hydnellum"}, :species=>{:string=>"scrobiculatum"}}]
563
- pos(sn).should == {0=>["genus", 12], 13=>["species", 23], 26=>["genus", 35], 36=>["species", 49]}
774
+ expect(parse(sn)).to_not be_nil
775
+ expect(parse(sn).hybrid).to eq true
776
+ expect(value(sn)).to eq "Arthopyrenia hyalospora \303\227 Hydnellum scrobiculatum"
777
+ expect(canonical(sn)).to eq "Arthopyrenia hyalospora × Hydnellum scrobiculatum"
778
+ expect(details(sn)).to eq [{:genus=>{:string=>"Arthopyrenia"}, :species=>{:string=>"hyalospora"}}, {:genus=>{:string=>"Hydnellum"}, :species=>{:string=>"scrobiculatum"}}]
779
+ expect(pos(sn)).to eq({0=>["genus", 12], 13=>["species", 23], 26=>["genus", 35], 36=>["species", 49]})
564
780
  sn = "Arthopyrenia hyalospora (Banker) D. Hall X Hydnellum scrobiculatum D.E. Stuntz"
565
- parse(sn).should_not be_nil
566
- parse(sn).hybrid.should be_true
567
- value(sn).should == "Arthopyrenia hyalospora (Banker) D. Hall \303\227 Hydnellum scrobiculatum D.E. Stuntz"
568
- canonical(sn).should == "Arthopyrenia hyalospora × Hydnellum scrobiculatum"
569
- pos(sn).should == {0=>["genus", 12], 13=>["species", 23], 25=>["author_word", 31], 33=>["author_word", 35], 36=>["author_word", 40], 43=>["genus", 52], 53=>["species", 66], 67=>["author_word", 71], 72=>["author_word", 78]}
570
- value("Arthopyrenia hyalospora X").should == "Arthopyrenia hyalospora \303\227 ?"
781
+ expect(parse(sn)).to_not be_nil
782
+ expect(parse(sn).hybrid).to eq true
783
+ expect(value(sn)).to eq "Arthopyrenia hyalospora (Banker) D. Hall \303\227 Hydnellum scrobiculatum D.E. Stuntz"
784
+ expect(canonical(sn)).to eq "Arthopyrenia hyalospora × Hydnellum scrobiculatum"
785
+ expect(pos(sn)).to eq({0=>["genus", 12], 13=>["species", 23], 25=>["author_word", 31], 33=>["author_word", 35], 36=>["author_word", 40], 43=>["genus", 52], 53=>["species", 66], 67=>["author_word", 71], 72=>["author_word", 78]})
786
+ expect(value("Arthopyrenia hyalospora X")).to eq "Arthopyrenia hyalospora \303\227 ?"
571
787
  sn = "Arthopyrenia hyalospora x"
572
- parse(sn).should_not be_nil
573
- parse(sn).hybrid.should be_true
574
- canonical(sn).should == "Arthopyrenia hyalospora"
575
- details(sn).should == [{:genus=>{:string=>"Arthopyrenia"}, :species=>{:string=>"hyalospora"}}, "?"]
576
- pos(sn).should == {0=>["genus", 12], 13=>["species", 23]}
788
+ expect(parse(sn)).to_not be_nil
789
+ expect(parse(sn).hybrid).to eq true
790
+ expect(canonical(sn)).to eq "Arthopyrenia hyalospora"
791
+ expect(details(sn)).to eq [{:genus=>{:string=>"Arthopyrenia"}, :species=>{:string=>"hyalospora"}}, "?"]
792
+ expect(pos(sn)).to eq({0=>["genus", 12], 13=>["species", 23]})
577
793
  sn = "Arthopyrenia hyalospora × ?"
578
- parse(sn).should_not be_nil
579
- parse(sn).hybrid.should be_true
580
- details(sn).should == [{:genus=>{:string=>"Arthopyrenia"}, :species=>{:string=>"hyalospora"}}, "?"]
581
- pos(sn).should == {0=>["genus", 12], 13=>["species", 23]}
794
+ expect(parse(sn)).to_not be_nil
795
+ expect(parse(sn).hybrid).to eq true
796
+ expect(details(sn)).to eq [{:genus=>{:string=>"Arthopyrenia"}, :species=>{:string=>"hyalospora"}}, "?"]
797
+ expect(pos(sn)).to eq({0=>["genus", 12], 13=>["species", 23]})
582
798
  end
583
799
 
584
- it 'should parse names with taxon concept' do
800
+ it 'parses names with taxon concept' do
585
801
  sn = "Stenometope laevissimus sec. Eschmeyer 2004"
586
- details(sn).should == [{:genus=>{:string=>"Stenometope"}, :species=>{:string=>"laevissimus"}, :taxon_concept=>{:authorship=>"Eschmeyer 2004", :basionymAuthorTeam=>{:authorTeam=>"Eschmeyer", :author=>["Eschmeyer"], :year=>"2004"}}}]
587
- pos(sn).should == {0=>["genus", 11], 12=>["species", 23], 29=>["author_word", 38], 39=>["year", 43]}
802
+ expect(details(sn)).to eq [{:genus=>{:string=>"Stenometope"}, :species=>{:string=>"laevissimus"}, :taxon_concept=>{:authorship=>"Eschmeyer 2004", :basionymAuthorTeam=>{:authorTeam=>"Eschmeyer", :author=>["Eschmeyer"], :year=>"2004"}}}]
803
+ expect(pos(sn)).to eq({0=>["genus", 11], 12=>["species", 23], 29=>["author_word", 38], 39=>["year", 43]})
588
804
  sn = "Stenometope laevissimus Bibron 1855 sec. Eschmeyer 2004"
589
- parse(sn).should_not be_nil
590
- details(sn).should == [{:genus=>{:string=>"Stenometope"}, :species=>{:string=>"laevissimus", :authorship=>"Bibron 1855", :basionymAuthorTeam=>{:authorTeam=>"Bibron", :author=>["Bibron"], :year=>"1855"}}, :taxon_concept=>{:authorship=>"Eschmeyer 2004", :basionymAuthorTeam=>{:authorTeam=>"Eschmeyer", :author=>["Eschmeyer"], :year=>"2004"}}}]
591
- pos(sn).should == {0=>["genus", 11], 12=>["species", 23], 24=>["author_word", 30], 31=>["year", 35], 41=>["author_word", 50], 51=>["year", 55]}
805
+ expect(parse(sn)).to_not be_nil
806
+ expect(details(sn)).to eq [{:genus=>{:string=>"Stenometope"}, :species=>{:string=>"laevissimus", :authorship=>"Bibron 1855", :basionymAuthorTeam=>{:authorTeam=>"Bibron", :author=>["Bibron"], :year=>"1855"}}, :taxon_concept=>{:authorship=>"Eschmeyer 2004", :basionymAuthorTeam=>{:authorTeam=>"Eschmeyer", :author=>["Eschmeyer"], :year=>"2004"}}}]
807
+ expect(pos(sn)).to eq({0=>["genus", 11], 12=>["species", 23], 24=>["author_word", 30], 31=>["year", 35], 41=>["author_word", 50], 51=>["year", 55]})
592
808
  end
593
809
 
594
- it 'should parse names with spaces inconsistencies at the start and the end and in the middle' do
595
- parse(" Asplenium X inexpectatum (E.L. Braun 1940) Morton (1956) ").should_not be_nil
810
+ it 'parses names with spaces inconsistencies at the start and the end and in the middle' do
811
+ expect(parse(" Asplenium X inexpectatum (E.L. Braun 1940) Morton (1956) ")).to_not be_nil
596
812
  end
597
813
 
598
- it 'should parse names with any number of spaces' do
814
+ it 'parses names with any number of spaces' do
599
815
  sn = "Trematosphaeria phaeospora (E. Müll.) L. Holm 1957"
600
- parse(sn).should_not be_nil
601
- value(sn).should == "Trematosphaeria phaeospora (E. Müll.) L. Holm 1957"
602
- canonical(sn).should == "Trematosphaeria phaeospora"
603
- details(sn).should == [{:genus=>{:string=>"Trematosphaeria"}, :species=>{:string=>"phaeospora", :authorship=>"(E. Müll.) L. Holm 1957", :combinationAuthorTeam=>{:authorTeam=>"L. Holm", :author=>["L. Holm"], :year=>"1957"}, :basionymAuthorTeam=>{:authorTeam=>"E. Müll.", :author=>["E. Müll."]}}}]
604
- pos(sn).should == {0=>["genus", 15], 16=>["species", 26], 28=>["author_word", 30], 31=>["author_word", 36], 46=>["author_word", 48], 61=>["author_word", 65], 66=>["year", 70]}
816
+ expect(parse(sn)).to_not be_nil
817
+ expect(value(sn)).to eq "Trematosphaeria phaeospora (E. Müll.) L. Holm 1957"
818
+ expect(canonical(sn)).to eq "Trematosphaeria phaeospora"
819
+ expect(details(sn)).to eq [{:genus=>{:string=>"Trematosphaeria"}, :species=>{:string=>"phaeospora", :authorship=>"(E. Müll.) L. Holm 1957", :combinationAuthorTeam=>{:authorTeam=>"L. Holm", :author=>["L. Holm"], :year=>"1957"}, :basionymAuthorTeam=>{:authorTeam=>"E. Müll.", :author=>["E. Müll."]}}}]
820
+ expect(pos(sn)).to eq({0=>["genus", 15], 16=>["species", 26], 28=>["author_word", 30], 31=>["author_word", 36], 46=>["author_word", 48], 61=>["author_word", 65], 66=>["year", 70]})
605
821
  end
606
822
 
607
- it 'should not parse serveral authors groups with several years NOT CORRECT' do
608
- parse("Pseudocercospora dendrobii (H.C. Burnett 1883) (Leight.) (Movss. 1967) U. Braun & Crous 2003").should be_nil
823
+ it 'does not parse serveral authors groups with several years NOT CORRECT' do
824
+ expect(parse("Pseudocercospora dendrobii (H.C. Burnett 1883) (Leight.) (Movss. 1967) U. Braun & Crous 2003")).to be_nil
609
825
  end
610
826
 
611
- it "should not parse unallowed utf-8 chars in name part" do
612
- parse("Érematosphaeria phaespora").should be_nil
613
- parse("Trematosphaeria phaeáapora").should be_nil
614
- parse("Trematоsphaeria phaeaapora").should be_nil #cyrillic o
827
+ it "does not parse unallowed utf-8 chars in name part" do
828
+ expect(parse("Érematosphaeria phaespora")).to be_nil
829
+ expect(parse("Trematosphaeria phaeáapora")).to be_nil
830
+ expect(parse("Trematоsphaeria phaeaapora")).to be_nil #cyrillic o
615
831
  end
616
832
 
617
- it "should parse new stuff" do
833
+ it "parses new stuff" do
618
834
  sn = 'Nesticus quelpartensis Paik & Namkung, in Paik, Yaginuma & Namkung, 1969'
619
- details(sn).should == [{:genus=>{:string=>"Nesticus"}, :species=>{:string=>"quelpartensis", :authorship=>"Paik & Namkung, in Paik, Yaginuma & Namkung, 1969", :basionymAuthorTeam=>{:authorTeam=>"Paik & Namkung", :author=>["Paik", "Namkung"], :exAuthorTeam=>{:authorTeam=>"Paik, Yaginuma & Namkung", :author=>["Paik", "Yaginuma", "Namkung"], :year=>"1969"}}}}]
620
- parse('Dipoena yoshidai Ono, in Ono et al., 1991').should_not be_nil
835
+ expect(details(sn)).to eq [{:genus=>{:string=>"Nesticus"}, :species=>{:string=>"quelpartensis", :authorship=>"Paik & Namkung, in Paik, Yaginuma & Namkung, 1969", :basionymAuthorTeam=>{:authorTeam=>"Paik & Namkung", :author=>["Paik", "Namkung"], :exAuthorTeam=>{:authorTeam=>"Paik, Yaginuma & Namkung", :author=>["Paik", "Yaginuma", "Namkung"], :year=>"1969"}}}}]
836
+ expect(parse('Dipoena yoshidai Ono, in Ono et al., 1991')).to_not be_nil
621
837
  sn = 'Latrodectus mactans bishopi Kaston, 1938'
622
- details(sn).should == [{:genus=>{:string=>"Latrodectus"}, :species=>{:string=>"mactans"}, :infraspecies=>[{:string=>"bishopi", :rank=>"n/a", :authorship=>"Kaston, 1938", :basionymAuthorTeam=>{:authorTeam=>"Kaston", :author=>["Kaston"], :year=>"1938"}}]}]
838
+ expect(details(sn)).to eq [{:genus=>{:string=>"Latrodectus"}, :species=>{:string=>"mactans"}, :infraspecies=>[{:string=>"bishopi", :rank=>"n/a", :authorship=>"Kaston, 1938", :basionymAuthorTeam=>{:authorTeam=>"Kaston", :author=>["Kaston"], :year=>"1938"}}]}]
623
839
  sn = 'Thiobacillus x Parker and Prisk 1953' #have to figure out black lists for this one
624
840
  sn = 'Bacille de Plaut, Kritchevsky and Séguin 1921'
625
- details(sn).should == [{:uninomial=>{:string=>"Bacille", :authorship=>"de Plaut, Kritchevsky and Séguin 1921", :basionymAuthorTeam=>{:authorTeam=>"de Plaut, Kritchevsky and Séguin", :author=>["de Plaut", "Kritchevsky", "Séguin"], :year=>"1921"}}}]
841
+ expect(details(sn)).to eq [{:uninomial=>{:string=>"Bacille", :authorship=>"de Plaut, Kritchevsky and Séguin 1921", :basionymAuthorTeam=>{:authorTeam=>"de Plaut, Kritchevsky and Séguin", :author=>["de Plaut", "Kritchevsky", "Séguin"], :year=>"1921"}}}]
626
842
  sn = 'Araneus van bruysseli Petrunkevitch, 1911'
627
- details(sn).should == [{:genus=>{:string=>"Araneus"}, :species=>{:string=>"van"}, :infraspecies=>[{:string=>"bruysseli", :rank=>"n/a", :authorship=>"Petrunkevitch, 1911", :basionymAuthorTeam=>{:authorTeam=>"Petrunkevitch", :author=>["Petrunkevitch"], :year=>"1911"}}]}]
843
+ expect(details(sn)).to eq [{:genus=>{:string=>"Araneus"}, :species=>{:string=>"van"}, :infraspecies=>[{:string=>"bruysseli", :rank=>"n/a", :authorship=>"Petrunkevitch, 1911", :basionymAuthorTeam=>{:authorTeam=>"Petrunkevitch", :author=>["Petrunkevitch"], :year=>"1911"}}]}]
628
844
  sn = 'Sapromyces laidlawi ab Sabin 1941'
629
- details(sn).should == [{:genus=>{:string=>"Sapromyces"}, :species=>{:string=>"laidlawi", :authorship=>"ab Sabin 1941", :basionymAuthorTeam=>{:authorTeam=>"ab Sabin", :author=>["ab Sabin"], :year=>"1941"}}}]
845
+ expect(details(sn)).to eq [{:genus=>{:string=>"Sapromyces"}, :species=>{:string=>"laidlawi", :authorship=>"ab Sabin 1941", :basionymAuthorTeam=>{:authorTeam=>"ab Sabin", :author=>["ab Sabin"], :year=>"1941"}}}]
630
846
  sn = 'Nocardia rugosa di Marco and Spalla 1957'
631
- details(sn).should == [{:genus=>{:string=>"Nocardia"}, :species=>{:string=>"rugosa", :authorship=>"di Marco and Spalla 1957", :basionymAuthorTeam=>{:authorTeam=>"di Marco and Spalla", :author=>["di Marco", "Spalla"], :year=>"1957"}}}]
847
+ expect(details(sn)).to eq [{:genus=>{:string=>"Nocardia"}, :species=>{:string=>"rugosa", :authorship=>"di Marco and Spalla 1957", :basionymAuthorTeam=>{:authorTeam=>"di Marco and Spalla", :author=>["di Marco", "Spalla"], :year=>"1957"}}}]
632
848
  sn = 'Flexibacter elegans Lewin 1969 non Soriano 1945'
633
- details(sn).should == [{:genus=>{:string=>"Flexibacter"}, :species=>{:string=>"elegans", :authorship=>"Lewin 1969 non Soriano 1945", :basionymAuthorTeam=>{:authorTeam=>"Lewin", :author=>["Lewin"], :year=>"1969"}}}]
849
+ expect(details(sn)).to eq [{:genus=>{:string=>"Flexibacter"}, :species=>{:string=>"elegans", :authorship=>"Lewin 1969 non Soriano 1945", :basionymAuthorTeam=>{:authorTeam=>"Lewin", :author=>["Lewin"], :year=>"1969"}}}]
634
850
  sn = 'Flexibacter elegans Soriano 1945, non Lewin 1969'
635
- details(sn).should == [{:genus=>{:string=>"Flexibacter"}, :species=>{:string=>"elegans", :authorship=>"Soriano 1945, non Lewin 1969", :basionymAuthorTeam=>{:authorTeam=>"Soriano", :author=>["Soriano"], :year=>"1945"}}}]
851
+ expect(details(sn)).to eq [{:genus=>{:string=>"Flexibacter"}, :species=>{:string=>"elegans", :authorship=>"Soriano 1945, non Lewin 1969", :basionymAuthorTeam=>{:authorTeam=>"Soriano", :author=>["Soriano"], :year=>"1945"}}}]
636
852
  sn = 'Schottera nicaeënsis (J.V. Lamouroux ex Duby) Guiry & Hollenberg'
637
- details(sn).should == [{:genus=>{:string=>"Schottera"}, :species=>{:string=>"nicaeensis", :authorship=>"(J.V. Lamouroux ex Duby) Guiry & Hollenberg", :combinationAuthorTeam=>{:authorTeam=>"Guiry & Hollenberg", :author=>["Guiry", "Hollenberg"]}, :basionymAuthorTeam=>{:authorTeam=>"J.V. Lamouroux", :author=>["J.V. Lamouroux"], :exAuthorTeam=>{:authorTeam=>"Duby", :author=>["Duby"]}}}}]
853
+ expect(details(sn)).to eq [{:genus=>{:string=>"Schottera"}, :species=>{:string=>"nicaeensis", :authorship=>"(J.V. Lamouroux ex Duby) Guiry & Hollenberg", :combinationAuthorTeam=>{:authorTeam=>"Guiry & Hollenberg", :author=>["Guiry", "Hollenberg"]}, :basionymAuthorTeam=>{:authorTeam=>"J.V. Lamouroux", :author=>["J.V. Lamouroux"], :exAuthorTeam=>{:authorTeam=>"Duby", :author=>["Duby"]}}}}]
638
854
  sn = 'Deschampsia cespitosa ssp pumila'
639
- details(sn).should == [{:genus=>{:string=>"Deschampsia"}, :species=>{:string=>"cespitosa"}, :infraspecies=>[{:string=>"pumila", :rank=>"ssp"}]}]
855
+ expect(details(sn)).to eq [{:genus=>{:string=>"Deschampsia"}, :species=>{:string=>"cespitosa"}, :infraspecies=>[{:string=>"pumila", :rank=>"ssp"}]}]
640
856
  end
641
857
 
642
- # Combination genus names should be merged without dash or capital letter
643
- it 'should parse hybrid names with capitalized second name in genus (botanical code error)' do
858
+ # Combination genus names merges without dash or capital letter
859
+ it 'parses hybrid names with capitalized second name in genus (botanical code error)' do
644
860
  sn = 'Anacampti-Platanthera P. Fourn.'
645
- parse(sn).should_not be_nil
646
- canonical(sn).should == 'Anacamptiplatanthera'
861
+ expect(parse(sn)).to_not be_nil
862
+ expect(canonical(sn)).to eq 'Anacamptiplatanthera'
647
863
  sn = 'Anacampti-Platanthera vulgaris P. Fourn.'
648
- parse(sn).should_not be_nil
649
- canonical(sn).should == 'Anacamptiplatanthera vulgaris'
864
+ expect(parse(sn)).to_not be_nil
865
+ expect(canonical(sn)).to eq 'Anacamptiplatanthera vulgaris'
650
866
  end
651
867
 
652
- it 'should parse genus names starting with uppercase letters AE OE' do
868
+ it 'parses genus names starting with uppercase letters AE OE' do
653
869
  sn = 'AEmona separata Broun 1921'
654
- canonical(sn).should == 'Aemona separata'
870
+ expect(canonical(sn)).to eq 'Aemona separata'
655
871
  sn = 'OEmona simplex White, 1855'
656
- canonical(sn).should == 'Oemona simplex'
872
+ expect(canonical(sn)).to eq 'Oemona simplex'
657
873
  end
658
874
  #"Arthrosamanea eriorhachis (Harms & sine ref. ) Aubrév." -- ignore & sine ref. (means without reference)
659
875
 
@@ -661,7 +877,7 @@ describe ScientificNameClean do
661
877
  new stuff
662
878
 
663
879
  sn = "Orchidaceae × Asconopsis hort."
664
- canonical(sn).should == "Orchidaceae x Asconopsis"
880
+ expect(canonical(sn)).to eq "Orchidaceae x Asconopsis"
665
881
  sn
666
882
  Tamiops swinhoei near hainanus|Tamiops swinhoei near hainanus
667
883
  Conus textile form archiepiscopus|Conus textile form archiepiscopus|