forked from faker-ruby/faker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds the Faker::Sports::Basketball generator (faker-ruby#1537)
- Loading branch information
Showing
5 changed files
with
161 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Faker::Sports::Basketball | ||
|
||
```ruby | ||
Faker::Sports::Basketball.team #=> "Golden State Warriors" | ||
|
||
Faker::Sports::Basketball.player #=> "LeBron James" | ||
|
||
Faker::Sports::Basketball.coach #=> "Gregg Popovich" | ||
|
||
Faker::Sports::Basketball.position #=> "Point Guard" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
module Sports | ||
class Basketball < Base | ||
class << self | ||
def team | ||
fetch('basketball.teams') | ||
end | ||
|
||
def player | ||
fetch('basketball.players') | ||
end | ||
|
||
def coach | ||
fetch('basketball.coaches') | ||
end | ||
|
||
def position | ||
fetch('basketball.positions') | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
en: | ||
faker: | ||
basketball: | ||
teams: | ||
- Atlanta Hawks | ||
- Boston Celtics | ||
- Brooklyn Nets | ||
- Charlotte Hornets | ||
- Chicago Bulls | ||
- Cleveland Cavaliers | ||
- Dallas Mavericks | ||
- Denver Nuggets | ||
- Detroit Pistons | ||
- Golden State Warriors | ||
- Houston Rockets | ||
- Indiana Pacers | ||
- Los Angeles Clippers | ||
- Los Angeles Lakers | ||
- Memphis Grizzlies | ||
- Miami Heat | ||
- Milwaukee Bucks | ||
- Minnesota Timberwolves | ||
- New Orleans Pelicans | ||
- New York Knicks | ||
- Oklahoma City Thunder | ||
- Orlando Magic | ||
- Philadelphia 76ers | ||
- Phoenix Suns | ||
- Portland Trail Blazers | ||
- Sacramento Kings | ||
- San Antonio Spurs | ||
- Toronto Raptors | ||
- Utah Jazz | ||
- Washington Wizards | ||
players: | ||
- Kemba Walker | ||
- Kyrie Irving | ||
- Kawhi Leonard | ||
- Giannis Antetokounmpo | ||
- Joel Embiid | ||
- Kyle Lowry | ||
- Victor Oladipo | ||
- Khris Middleton | ||
- Bradley Beal | ||
- Ben Simmons | ||
- Blake Griffin | ||
- Nikola Vučević | ||
- Dwayne Wade | ||
- D'Angelo Russell | ||
- Stephen Curry | ||
- James Harden | ||
- Kevin Durant | ||
- Paul George | ||
- LeBron James | ||
- Russell Westbrook | ||
- Damian Lillard | ||
- Klay Thompson | ||
- Anthony Davis | ||
- LaMarcus Aldridge | ||
- Nikola Jokić | ||
- Karl-Anthony Towns | ||
- Dirk Nowitzki | ||
coaches: | ||
- Kenny Atkinson | ||
- J.B. Bickerstaff | ||
- James Borrego | ||
- Jim Boylen | ||
- Scott Brooks | ||
- Brett Brown | ||
- Mike Budenholzer | ||
- Rick Carlisle | ||
- Dwane Casey | ||
- Steve Clifford | ||
- Mike D'Antoni | ||
- Billy Donovan | ||
- Larry Drew | ||
- David Fizdale | ||
- Alvin Gentry | ||
- Dave Joerger | ||
- Steve Kerr | ||
- Igor Kokoškov | ||
- Michael Malone | ||
- Nate McMillan | ||
- Nick Nurse | ||
- Lloyd Pierce | ||
- Gregg Popovich | ||
- Doc Rivers | ||
- Ryan Saunders | ||
- Quin Snyder | ||
- Erik Spoelstra | ||
- Brad Stevens | ||
- Terry Stotts | ||
- Luke Walton | ||
positions: | ||
- Point Guard | ||
- Shooting Guard | ||
- Small Forward | ||
- Power Forward | ||
- Center |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../../test_helper' | ||
|
||
class TestFakerBasketball < Test::Unit::TestCase | ||
def setup | ||
@tester = Faker::Sports::Basketball | ||
end | ||
|
||
def test_team | ||
assert @tester.team.match(/\w+/) | ||
end | ||
|
||
def test_player | ||
assert @tester.player.match(/\w+/) | ||
end | ||
|
||
def test_coach | ||
assert @tester.coach.match(/\w+/) | ||
end | ||
|
||
def test_position | ||
assert @tester.position.match(/\w+/) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters