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 a street fighter generator #2092

Merged
merged 2 commits into from
Jul 26, 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 @@ -245,6 +245,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
- [Faker::Games::Overwatch](doc/games/overwatch.md)
- [Faker::Games::Pokemon](doc/games/pokemon.md)
- [Faker::Games::SonicTheHedgehog](doc/games/sonic_the_hedgehog.md)
- [Faker::Games::StreetFighter](doc/games/street_fighter.md)
- [Faker::Games::SuperSmashBros](doc/games/super_smash_bros.md)
- [Faker::Games::WarhammerFantasy](doc/games/warhammer_fantasy.md)
- [Faker::Games::Witcher](doc/games/witcher.md)
Expand Down
6 changes: 6 additions & 0 deletions doc/games/street_fighter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Faker::Games::StreetFighter

```ruby

# Generate random playable character from Street Fighter
Faker::Games::StreetFighter.character # => "Ryu"
22 changes: 22 additions & 0 deletions lib/faker/games/street_fighter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

module Faker
class Games
class StreetFighter < Base
class << self
##
# Produces the name of a playable character from Street Fighter.
#
# @return [String]
#
# @example
# Faker::Games::StreetFighter.character #=> "Ryu"
#
# @faker.version next
def character
fetch('games.street_fighter.characters')
end
end
end
end
end
83 changes: 83 additions & 0 deletions lib/locales/en/street_fighter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
en:
faker:
games:
street_fighter:
characters:
- Abel
- Abigail
- Adon
- Akuma
- Alex
- Balrog
- Birdie
- Blanka
- C. Viper
- Cammy
- Charlie
- Chun-Li
- Cody
- Dan
- Decapre
- Dee Jay
- Dhalsim
- Dudley
- E. Honda
- Eagle
- Ed
- El Fuerte
- Elena
- Evil Ryu
- F.A.N.G
- Falke
- Fei Long
- G
- Gen
- Gill
- Gouken
- Guile
- Guy
- Hakan
- Hugo
- Ibuki
- Ingrid
- Juli
- Juni
- Juri
- Kage
- Karin
- Ken
- Kolin
- Laura
- Lucia
- M. Bison
- Maki
- Makoto
- Menat
- Necalli
- Necro
- Oni
- Oro
- Poison
- Q
- R. Mika
- Rashid
- Remy
- Rolento
- Rose
- Rufus
- Ryu
- Sagat
- Sakura
- Sean
- Seth
- Shin Akum
- Sodom
- T. Hawk
- Twelve
- Urien
- Vega
- Violent Ken
- Yang
- Yun
- Zangief
- Zeku
13 changes: 13 additions & 0 deletions test/faker/games/test_faker_street_fighter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

require_relative '../../test_helper'

class TestFakerStreetFighter < Test::Unit::TestCase
def setup
@tester = Faker::Games::StreetFighter
end

def test_character
assert @tester.character.match(/\w+/)
end
end