spec/lib/namor_spec.rb in namor-0.0.2 vs spec/lib/namor_spec.rb in namor-0.1.0

- old
+ new

@@ -57,9 +57,19 @@ end it "should handle pathological cases" do @namor.extract(", Mary Smith").should == ['MARY', 'SMITH', nil, 'MARY SMITH'] end + + it "should squash multi-part last names" do + @namor.extract("Al Hassan, Bashar").should == ['BASHAR', nil, 'ALHASSAN', 'ALHASSAN,BASHAR'] + @namor.extract("Bashar Al-Hassan").should == ['BASHAR', nil, 'ALHASSAN', 'ALHASSAN,BASHAR'] + end + + it "should squash hyphenated first names" do + @namor.extract("Smith,Anne-Marie").should == ['ANNEMARIE', nil, 'SMITH', 'SMITH,ANNEMARIE'] + end + end describe "with cluster coding" do before(:all) do @namor = Namor::Namor.new