Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
require File.dirname(__FILE__) + '/spec_helper' | ||
|
||
describe "nameable" do | ||
it "should do nothing" do | ||
true.should == true | ||
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." } | ||
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" } | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--colour | ||
--format nested | ||
--loadby mtime | ||
--reverse | ||
--backtrace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,10 @@ | ||
$TESTING=true | ||
$:.push File.join(File.dirname(__FILE__), '..', 'lib') | ||
$LOAD_PATH.push File.join(File.dirname(__FILE__), '..', 'lib') | ||
|
||
require "rubygems" | ||
require "spec" | ||
require "active_support" | ||
require "nameable" | ||
|
||
Spec::Runner.configure do |config| | ||
# config.mock_with :mocha | ||
end |