spec/lib/namor_spec.rb in namor-0.4.0 vs spec/lib/namor_spec.rb in namor-0.4.1

- old
+ new

@@ -3,11 +3,11 @@ require "spec_helper" describe "name extract" do before(:all) do @namor = Namor::Namor.new - @namor.config(:suppress => ['MD', 'dds', 'M\.D\.']) + @namor.config(:suppress => ['MD', 'dds', 'M\.D']) end it "should handle 2-part names without commas" do @namor.extract("john smith").should == ['JOHN', nil, 'SMITH', 'SMITH,JOHN', 'SMITH,JOHN'] end @@ -143,13 +143,16 @@ end it "should only suppress isolated terms" do @namor.scrub("Smith, Mary RN", :suppress => ['RN']).should == 'SMITH, MARY' @namor.scrub("Smith, Marnie", :suppress => ['RN']).should == 'SMITH, MARNIE' + + @namor.scrub("Gonzalez, Lourdes", :suppress => ['RN', 'RD', 'DO']).should == 'GONZALEZ, LOURDES' end it "should scrub words with periods" do - @namor.scrub("Smith, Mary M.D.", :suppress => ['M.D.']).should == 'SMITH, MARY' + @namor.scrub("Smith, Mary M.D.", :suppress => ['M.D']).should == 'SMITH, MARY' + @namor.scrub("Smith, Mary M.D.", :suppress => ['RN', 'M.D.', 'DDS']).should == 'SMITH, MARY' end it "should scrub individual name components of punctuation and titles" do @namor.fullscrub('Foxworthy-Smythe, ESQ.', :suppress => ['esq']).should == 'FOXWORTHYSMYTHE' end