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::Music::Rush #1912

Merged
merged 3 commits into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
- [Faker::Music::Opera](doc/music/opera.md)
- [Faker::Music::Phish](doc/music/phish.md)
- [Faker::Music::RockBand](doc/music/rock_band.md)
- [Faker::Music::Rush](doc/music/rush.md)
- [Faker::Music::UmphreysMcgee](doc/music/umphreys_mcgee.md)

### Quotes
Expand Down
7 changes: 7 additions & 0 deletions doc/music/rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Faker::Music::Rush

```ruby
Faker::Music::Rush.player #=> "Neil Peart"

Faker::Music::Rush.album #=> "Hold Your Fire"
```
37 changes: 37 additions & 0 deletions lib/faker/music/rush.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# frozen_string_literal: true

require_relative 'music'

module Faker
class Music
class Rush < Base
class << self
##
# Produces the name of a member of Rush
#
# @return [String]
#
# @example
# Faker::Music::Rush.player #=> "Geddy Lee"
#
# @faker.version next
def player
fetch('rush.players')
end

##
# Produces the name of a album by Rush
vbrazo marked this conversation as resolved.
Show resolved Hide resolved
#
# @return [String]
#
# @example
# Faker::Music::Rush.albums #=> "Hold Your Fire"
vbrazo marked this conversation as resolved.
Show resolved Hide resolved
#
# @faker.version next
def album
fetch('rush.albums')
end
end
end
end
end
32 changes: 32 additions & 0 deletions lib/locales/en/rush.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
en:
faker:
rush:
players:
- Geddy Lee
- Alex Lifeson
- Neil Peart
- John Rutsey
albums:
- Rush
- Fly by Night
- Caress of Steel
- 2112
- A Farewell to Kings
- Hemispheres
- Permanent Waves
- Moving Pictures
- Signals
- Grace Under Pressure
- Power Windows
- Hold Your Fire
- Presto
- Roll the Bones
- Counterparts
- Test for Echo
- Vapor Trails
- Snakes & Arrows
- Clockwork Angels
- All the World's a Stage
- Exit...Stage Left
- A Show of Hands
- Different Stages
17 changes: 17 additions & 0 deletions test/faker/music/test_faker_rush.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

require_relative '../../test_helper'

class TestFakerRush < Test::Unit::TestCase
def setup
@tester = Faker::Music::Rush
end

def test_player
assert @tester.player.match(/\w+/)
end

def test_album
assert @tester.album.match(/\w+/)
end
end