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 Faker::Nation.national_sport #1268

Merged
merged 6 commits into from
Jun 5, 2018
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Change Log

## HEAD Unreleased
### Latest update: 2018-06-02
### Latest update: 2018-06-05

### Feature Request
- [PR #1268](https://github.com/stympy/faker/pull/1268) Add Faker::Nation.national_sport [@gkunwar](https://github.com/gkunwar)
- [PR #1273](https://github.com/stympy/faker/pull/1273) Add Faker::Device [@vbrazo](https://github.com/vbrazo)
- [PR #1272](https://github.com/stympy/faker/pull/1272) Add Faker::DrWho.actor [@timcustard](https://github.com/timcustard)
- [PR #1270](https://github.com/stympy/faker/pull/1270) Add Faker::Name.middle_name [@vbrazo](https://github.com/vbrazo)
Expand Down Expand Up @@ -49,6 +50,7 @@
- [PR #900](https://github.com/stympy/faker/pull/900) Add Japanese lorem words to locale [@vietqhoang](https://github.com/vietqhoang)

### Update/add locales
- [PR #1275](https://github.com/stympy/faker/pull/1275) Fix typo; RedWine should be two words [@johnmuhl](https://github.com/johnmuhl)
- [PR #1269](https://github.com/stympy/faker/pull/1269) Update Faker::ProgrammingLanguage.name locales [@vbrazo](https://github.com/vbrazo)
- [PR #1140](https://github.com/stympy/faker/pull/1140) Add Estonian and Latvian locales [@maciej-szlosarczyk](https://github.com/maciej-szlosarczyk)
- [PR #1249](https://github.com/stympy/faker/pull/1249) Update list of name prefixes for sv locale. [kamilbielawski](https://github.com/kamilbielawski)
Expand Down
3 changes: 3 additions & 0 deletions doc/nation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ Faker::Nation.language #=> "Nepali"

# Random Capital City
Faker::Nation.capital_city #=> "Kathmandu"

# Random Natinal Sport
Faker::Nation.national_sport #=> "dandi biyo"
5 changes: 5 additions & 0 deletions lib/faker/nation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ def language
def capital_city
fetch('nation.capital_city')
end

# Fetch random natinal sport
def national_sport
fetch('team.sport')
end
end
end
end
2 changes: 1 addition & 1 deletion lib/locales/en/team.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ en:
creature: ['ants', 'bats', 'bears', 'bees', 'birds', 'buffalo', 'cats', 'chickens', 'cattle', 'dogs', 'dolphins', 'ducks', 'elephants', 'fishes', 'foxes', 'frogs', 'geese', 'goats', 'horses', 'kangaroos', 'lions', 'monkeys', 'owls', 'oxen', 'penguins', 'people', 'pigs', 'rabbits', 'sheep', 'tigers', 'whales', 'wolves', 'zebras', 'banshees', 'crows', 'black cats', 'chimeras', 'ghosts', 'conspirators', 'dragons', 'dwarves', 'elves', 'enchanters', 'exorcists', 'sons', 'foes', 'giants', 'gnomes', 'goblins', 'gooses', 'griffins', 'lycanthropes', 'nemesis', 'ogres', 'oracles', 'prophets', 'sorcerors', 'spiders', 'spirits', 'vampires', 'warlocks', 'vixens', 'werewolves', 'witches', 'worshipers', 'zombies', 'druids']
name:
- "#{Address.state} #{creature}"
sport: ['baseball', 'basketball', 'football', 'hockey', 'rugby', 'lacrosse', 'soccer']
sport: ['baseball', 'basketball', 'football', 'hockey', 'rugby', 'lacrosse', 'soccer', 'buzkashi', 'cricket', 'kabaddi', 'archery', 'field hockey', 'wrestling', 'association', 'sumo', 'dandi biyo', 'league', 'arnis', 'bandy', 'taekwondo', 'volley ball', 'oil wrestling', 'handball', 'pesäpallo', 'rugby union', 'golf', 'bull fighting', 'shooting', 'gymnastics', 'water polo']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ 💛 🖤 💚 💙

mascot: ['Raymond', 'Bailey', 'Rocky', 'Screech', 'Steely McBeam', 'Nordy', 'Hugo', 'Griz', 'Iceburgh', 'Mr. Redlegs', 'Benny the Bull', 'Big Red', 'Suns Gorilla', 'Pirate Parrot', 'Ragar the Viking', 'JazzBear', 'Wally the Green Monster', 'Burnie', 'K.C. Wolf', 'Sausages', 'Mr. Met', 'Youppi', 'The Raptor', 'Jaxson De Ville', 'Phanatic']
4 changes: 4 additions & 0 deletions test/test_faker_nation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ def test_language
def test_capital_city
assert @tester.capital_city.match(/(\w+\.? ?){2,3}/)
end

def test_natinonal_sport
assert @tester.national_sport.match(/(\w+\.? ?){2,3}/)
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

end