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

Added rock band song generator #2221

Merged
merged 3 commits into from
Jan 10, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
12 changes: 12 additions & 0 deletions lib/faker/music/rock_band.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ class << self
def name
fetch('rock_band.name')
end

# Produces a rock song.
#
# @return [String]
#
# @example
# Faker::Music::RockBand.song #=> "Dani California"
#
# @faker.version next
def song
fetch('rock_band.song')
end
end
end
end
Expand Down
1 change: 1 addition & 0 deletions lib/locales/en/rock_band.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ en:
faker:
rock_band:
name: ["Led Zeppelin", "The Beatles", "Pink Floyd", "The Jimi Hendrix Experience", "Van Halen", "Queen", "The Eagles", "Metallica", "U2", "Bob Marley and the Wailers", "The Police", "The Doors", "Stone Temple Pilots", "Rush", "Genesis", "Prince and the Revolution", "Yes", "Earth Wind and Fire", "The Bee Gees", "The Rolling Stones", "The Beach Boys", "Soundgarden", "The Who", "Steely Dan", "James Brown and the JBs", "AC/DC", "Fleetwood Mac", "Crosby, Stills, Nash and Young", "The Allman Brothers", "ZZ Top", "Aerosmith", "Cream", "Bruce Springsteen & The E Street Band", "The Grateful Dead", "Guns 'N Roses", "Pearl Jam", "Boston", "Dire Straits", "King Crimson", "Parliament Funkadelic", "Red Hot Chili Peppers", "Bon Jovi", "Dixie Chicks", "Foreigner", "David Bowie and The Spiders From Mars", "The Talking Heads", "Jethro Tull", "The Band", "The Beastie Boys", "Nirvana", "Rage Against The Machine", "Sly and the Family Stone", "The Clash", "Tool", "Journey", "No Doubt", "Creedence Clearwater Revival", "Deep Purple", "Alice In Chains", "Orbital", "Little Feat", "Duran Duran", "Living Colour", "Frank Zappa and the Mothers of Invention", "The Carpenters", "Audioslave", "The Pretenders", "Primus", "Blondie", "Black Sabbath", "Lynyrd Skynyrd", "Sex Pistols", "Isaac Hayes and the Movement", "R.E.M.", "Traffic", "Buffalo Springfield", "Derek and the Dominos", "The Jackson Five", "The O'Jays", "Harold Melvin and the Blue Notes", "Underworld", "Thievery Corporation", "Motley Crue", "Janis Joplin and Big Brother and the Holding Company", "Blind Faith", "The Animals", "The Roots", "The Velvet Underground", "The Kinks", "Radiohead", "The Scorpions", "Kansas", "Iron Maiden", "Motorhead", "Judas Priest", "The Orb", "The Cure", "Coldplay", "Slayer", "Black Eyed Peas"]
song: ["Are You Gonna Be My Girl", "Dani California", "Detroit Rock City"]
Copy link
Member

Choose a reason for hiding this comment

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

Could you please add more examples?

4 changes: 4 additions & 0 deletions test/faker/music/test_faker_rock_band.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ def setup
def test_name
assert @tester.name.match(/\w+/)
end

def test_song
assert @tester.song.match(/\w+/)
end
end