Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add full_address to address_br #321

Merged
merged 3 commits into from May 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions REFERENCE.md
Expand Up @@ -204,6 +204,7 @@
| `street_name` | Serina Parkway, Quitzon Well, Kunze Groves |
| `street_prefix` | Avenida, Avenida, Alameda |
| `street_suffix` | Spring, Haven, Dale |
| `full_address` | Rua Omar Brito, 64378, Araucária, Belo Horizonte, Brazil |
| `time_zone` | Europe/London, Europe/Dublin, Asia/Singapore |
| `uk_country` | ❗ *[uk_country] is deprecated. For UK addresses please use the AddressUK module* |
| `uk_county` | ❗ *[uk_county] is deprecated. For UK addresses please use the AddressUK module* |
Expand Down
4 changes: 4 additions & 0 deletions lib/ffaker/address_br.rb
Expand Up @@ -37,5 +37,9 @@ def street
when 1 then "#{street_prefix} #{NameBR.first_name} #{NameBR.last_name} #{NameBR.last_name}"
end
end

def full_address
"#{street}, #{building_number}, #{city}, #{state}, Brazil"
end
end
end
2 changes: 1 addition & 1 deletion test/test_address_br.rb
Expand Up @@ -7,7 +7,7 @@ class TestAddressBR < Test::Unit::TestCase

assert_methods_are_deterministic(
FFaker::AddressBR,
:zip_code, :state, :state_abbr, :city, :street_prefix, :street
:zip_code, :state, :state_abbr, :city, :street_prefix, :street, :full_address
)

def test_zip_code
Expand Down
3 changes: 2 additions & 1 deletion test/test_lorem_fr.rb
Expand Up @@ -10,6 +10,7 @@ class TestLoremFR < Test::Unit::TestCase
:paragraph, :paragraphs, :sentence, :sentences,
:phrase, :phrases, :word, :words
)
REGEX = /\A[ -.ÀÂÉÈÊÎÔÚÛàâéèêîôùûa-z]+\z/i

def test_paragraph
assert_match(/\A[ -.àâéèêîôùûa-z]+\z/i, FFaker::LoremFR.paragraph)
Expand All @@ -24,7 +25,7 @@ def test_phrase
end

def test_paragraphsLoremFR
assert_match(/\A[ -.àâéèêîôùûa-z]+\z/i, FFaker::LoremFR.paragraphs.join(' '))
assert_match(REGEX, FFaker::LoremFR.paragraphs.join(' '))
end

def test_sentences
Expand Down