spec/nameable_spec.rb in nameable-0.5.1 vs spec/nameable_spec.rb in nameable-1.0.0
- old
+ new
@@ -1,21 +1,9 @@
-require File.dirname(__FILE__) + '/spec_helper'
-
-describe Nameable::Latin do
- describe "with 'Mr. Chris Horn PhD" do
- subject { Nameable::Latin.new.parse("Mr. Chris Horn PhD") }
-
- it("should extract prefix") { subject.prefix.should == "Mr." }
- it("should extract first name") { subject.first.should == "Chris" }
- it("should extract last name") { subject.last.should == "Horn" }
- it("should extract and normalize suffix") { subject.suffix.should == "Ph.D." }
+context("convenience") do
+ it 'to_s' do
+ expect(Nameable("Chris Horn")).to be_a(String)
end
- describe "with 'Chris Old Biscuit Barrel Horn'" do
- subject { Nameable::Latin.new.parse("Chris Old Biscuit Barrel Horn") }
-
- it("should extract first name") { subject.first.should == "Chris" }
- it("should extract middle name") { subject.middle.should == "Old Biscuit Barrel" }
- it("should extract last name") { subject.last.should == "Horn" }
+ it 'parse' do
+ expect(Nameable.parse("Chris Horn")).to be_a(Nameable::Latin)
end
-
end