Skip to content

Commit

Permalink
added ability for email_address to accept the name portion of the value
Browse files Browse the repository at this point in the history
  • Loading branch information
cheezy committed Dec 22, 2012
1 parent 7d906cb commit f68ec41
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -2,6 +2,7 @@
* Enhancements
* Added title translator
* Added ability for street_address translator to also include secondary address
* Added ability for email_address to accept the name portion of the value

=== Version 0.10 / 2012-12-8
* Enhancements
Expand Down
1 change: 1 addition & 0 deletions features/data_magic.feature
Expand Up @@ -31,6 +31,7 @@ Feature: Functionality of the data_magic gem

Scenario: Getting an email address from the yaml
Then the value for "email" should be 1 word long
And the value for "email_plus" should include "buddy"
And the value for "domain_name" should be 1 word long
And the value for "user_name" should be 1 word long

Expand Down
4 changes: 4 additions & 0 deletions features/step_definitions/data_magic_steps.rb
Expand Up @@ -69,3 +69,7 @@ class TestClass
value = @data[key]
value[-1 * num.to_i,num.to_i].downcase.should == value[-3,3]
end

Then /^the value for "(.*?)" should include "(.*?)"$/ do |key, value|
@data[key].should include value
end
1 change: 1 addition & 0 deletions features/yaml/example.yml
Expand Up @@ -16,6 +16,7 @@ dm:
second_address: ~secondary_address
company: ~company_name
email: ~email_address
email_plus: ~email_address('buddy')
domain_name: ~domain_name
user_name: ~user_name
phone: ~phone_number
Expand Down
4 changes: 2 additions & 2 deletions lib/data_magic/translation.rb
Expand Up @@ -144,8 +144,8 @@ def characters(character_count = 255)
#
# return a random email address
#
def email_address
Faker::Internet.email
def email_address(name=nil)
Faker::Internet.email(name)
end

#
Expand Down

0 comments on commit f68ec41

Please sign in to comment.