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::Football.position #1438

Merged
merged 1 commit into from
Oct 23, 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
2 changes: 2 additions & 0 deletions doc/football.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ Faker::Football.player #=> "Lionel Messi"
Faker::Football.coach #=> "Jose Mourinho"

Faker::Football.competition #=> "FIFA World Cup"

Faker::Football.position #=> "Defensive Midfielder"
```

4 changes: 4 additions & 0 deletions lib/faker/football.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ def coach
def competition
fetch('football.competitions')
end

def position
fetch('football.positions')
end
end
end
end
1 change: 1 addition & 0 deletions lib/locales/en/football.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ en:
players: ["Lionel Messi", "Gerard Pique", "Sergio Ramos", "Cristiano Ronaldo", "David De Gea", "Paul Pogba", "Antoine Griezmann", "Alvaro Morata", "Andres Iniesta", "Roberto Firmino", "Mohammed Salah", "Harry Kane", "Delle Alli", "Arjen Robben", "Franck Ribery", "Marco Reus", "Robert Lewandoski", "Zlatan Ibrahimovic", "Edinson Cavani", "Sergio Aguero", "Neymar", "Mesut Ozil", "Gianluigi Buffon", "Willian", "Manuel Neuer", "Juan Mata", "Manuel Neuer", "Cesc Fabregas", "Gareth Bale", "Eden Hazard", "Mario Mandzukic"]
coaches: ["Ernesto Valverde", "Zinedine Zidane", "Jose Mourinho", "Antonio Conte", "Jurgen Klopp", "Mauricio Pochettino", "Diego Simeone", "Massimiliano Allegri", "Jupp Heyneckes", "Arsene Wenger", "Jorge Sampaoli", "Fernando Santos", "Didier Deschamps", "Joachim Low", "Julen Lopetegui", "Mauricio Pochettino", "Unai Emery", "Massimiliano Allegri" ]
competitions: ["UEFA European Championship", "Asian Cup", "African Cup of Nations", "Copa America", "UEFA Champions League", "FIFA World Cup", "UEFA Europa League", "Serie A", "Barclays Premier League", "Bundesliga", "Liga Santander", "FA Cup", "Ligue 1", "Primeira Liga", "Eredivisie", "Super League", "Major League Soccer", "Coppa Italia", "DFB Pokal", "CONCACAF Gold Cup", "Nations Cup", "Copa del Rey"]
positions: ["Goalkeeper", "Full Back", "Right Back", "Left Back", "Defensive Midfielder", "Midfielder", "Attacking Midfielder", "Right Midfielder", "Left Midfielder", "Right Wing", "Left Wing", "Second Striker", "Centre Forward"]
4 changes: 4 additions & 0 deletions test/test_faker_football.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ def test_coach
def test_competition
assert @tester.competition.match(/\w+/)
end

def test_position
assert @tester.position.match(/\w+/)
end
end