dimus-taxamatch_rb 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/taxamatch_rb.rb CHANGED
@@ -24,7 +24,7 @@ module Taxamatch
24
24
  def taxamatch(str1, str2)
25
25
  preparsed_1 = @parser.parse(str1)
26
26
  preparsed_2 = @parser.parse(str2)
27
- taxamatch_preparsed(preparsed_1, preparsed_2)['match']
27
+ taxamatch_preparsed(preparsed_1, preparsed_2)['match'] rescue false
28
28
  end
29
29
 
30
30
  #takes two hashes of parsed scientific names, analyses them and returns back
@@ -65,6 +65,10 @@ describe 'Taxamatch::Base' do
65
65
  end
66
66
  end
67
67
 
68
+ it 'should work with names that cannot be parsed' do
69
+ res = @tm.taxamatch('Quadraspidiotus ostreaeformis MacGillivray, 1921','Quadraspidiotus ostreaeformis Curtis)')
70
+ res = false
71
+ end
68
72
 
69
73
  it 'should compare genera' do
70
74
  #edit distance 1 always match
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dimus-taxamatch_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Mozzherin