Skip to content
Browse files

Fix .first_name in Forgery::Name (this is why we test)

  • Loading branch information...
1 parent 78dd670 commit b3093ff1186d07318eeecde742197bc4ab15201d @nate nate committed Sep 4, 2011
Showing with 8 additions and 1 deletion.
  1. +1 −1 lib/forgery/forgery/name.rb
  2. +7 −0 spec/forgery/name_spec.rb
View
2 lib/forgery/forgery/name.rb
@@ -5,7 +5,7 @@ def self.last_name
end
def self.first_name
- [dictionaries[:male_first_names], dictionaries[:female_first_names]].random.random.unextend
+ Forgery::Extend(dictionaries[:male_first_names] + dictionaries[:female_first_names]).random.unextend
end
def self.full_name
View
7 spec/forgery/name_spec.rb
@@ -1,4 +1,11 @@
require 'spec_helper'
describe Forgery::Name do
+ it "should return a random first name" do
+ (Forgery.dictionaries[:male_first_names] + Forgery.dictionaries[:female_first_names]).should include(Forgery::Name.first_name)
+ end
+
+ it "should return a random last name" do
+ Forgery.dictionaries[:last_names].should include(Forgery::Name.last_name)
+ end
end

0 comments on commit b3093ff

Please sign in to comment.
Something went wrong with that request. Please try again.