spec/lib/parser_spec.rb in biodiversity-4.0.0 vs spec/lib/parser_spec.rb in biodiversity-4.0.1
- old
+ new
@@ -13,9 +13,17 @@
it 'parsed name in full format' do
parsed = subject.parse('Homo sapiens Linn.')
expect(parsed[:canonicalName][:simple]).to eq 'Homo sapiens'
expect(parsed[:normalized]).to eq 'Homo sapiens Linn.'
end
+
+ it 'gets quality and year correctly in simple form' do
+ parsed = subject.parse('Homo sapiens Linn. 1758', true)
+ expect(parsed[:canonicalName][:simple]).to eq 'Homo sapiens'
+ expect(parsed[:year]).to eq '1758'
+ expect(parsed[:quality]).to eq '1'
+ expect(parsed[:normalized]).to be_nil
+ end
end
describe('parse_ary') do
it 'parses names in simple format' do
parsed = subject.parse_ary(['Homo sapiens Linn.', 'Pardosa moesta'], true)