Skip to content

Commit

Permalink
Add Faker::Game with title, genre, and platform generators. (faker-ru…
Browse files Browse the repository at this point in the history
…by#1607)

* Add Faker::Game with title, genre, and platform generators.

* Add game platform test.

* Simplify Faker::Game tests.

* Move game documentation link to unreleased README.md.

* Move Faker::Game documentation to unreleased folder.
  • Loading branch information
connorshea authored and michebble committed Feb 16, 2020
1 parent d2976c5 commit 9b97b52
Show file tree
Hide file tree
Showing 5 changed files with 306 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doc/unreleased/games/game.md
@@ -0,0 +1,12 @@
# Faker::Game

```ruby
# Random Game Title
Faker::Game.title #=> "Half-Life"

# Random Game Genre
Faker::Game.genre #=> "First-person shooter"

# Random Game Platform
Faker::Game.platform #=> "Nintendo DS"
```
21 changes: 21 additions & 0 deletions lib/faker/games/game.rb
@@ -0,0 +1,21 @@
# frozen_string_literal: true

module Faker
class Game < Base
flexible :game

class << self
def title
fetch('game.title')
end

def genre
fetch('game.genre')
end

def platform
fetch('game.platform')
end
end
end
end
251 changes: 251 additions & 0 deletions lib/locales/en/game.yml
@@ -0,0 +1,251 @@
en:
faker:
game:
title:
- 'Half-Life'
- 'Half-Life: Opposing Force'
- 'Half-Life: Blue Shift'
- 'Half-Life 2'
- 'Half-Life 2: Episode One'
- 'Half-Life 2: Episode Two'
- 'Half-Life 2: Lost Coast'
- 'Portal'
- 'Portal 2'
- 'Team Fortress Classic'
- 'Team Fortress 2'
- 'Left 4 Dead'
- 'Left 4 Dead 2'
- 'Day of Defeat'
- 'Ricochet'
- 'Dota 2'
- 'Counter-Strike'
- 'Counter-Strike: Source'
- 'Counter-Strike: Global Offensive'
- "Garry's Mod"
- 'Super Mario Bros.'
- 'Super Mario Bros. 2'
- 'Super Mario Bros. 3'
- 'Super Mario World'
- 'Super Mario Sunshine'
- 'Super Mario Galaxy'
- 'Super Mario Galaxy 2'
- 'Super Mario Odyssey'
- 'Mario Kart 64'
- 'Mario Kart: Double Dash'
- 'Mario Kart DS'
- 'Mario Kart Wii'
- 'Mario Kart 7'
- 'Mario Kart 8'
- 'Mario Kart 8 Deluxe'
- "Luigi's Mansion"
- 'Animal Crossing'
- 'Animal Crossing: Wild World'
- 'Animal Crossing: City Folk'
- 'Animal Crossing: New Leaf'
- 'Civilization III'
- 'Civilization IV'
- 'Civilization V'
- 'Civilization VI'
- 'The Legend of Zelda'
- 'The Legend of Zelda: Ocarina of Time'
- "The Legend of Zelda: Majora's Mask"
- 'The Legend of Zelda: Twilight Princess'
- 'The Legend of Zelda: Skyward Sword'
- 'The Legend of Zelda: Breath of the Wild'
- 'Pong'
- 'Pac-Man'
- 'Starcraft'
- 'Starcraft II'
- 'Overwatch'
- 'Hearthstone'
- 'Halo: Combat Evolved'
- 'Halo 2'
- 'Halo 3'
- 'Halo 3: ODST'
- 'Halo: Reach'
- 'Halo 4'
- 'Halo 5: Guardians'
- 'Wii Sports'
- 'Wii Sports Resort'
- 'Wii Play'
- 'Wii Music'
- 'Pokémon Red'
- 'Pokémon Blue'
- 'Pokémon Yellow'
- 'Pokémon Gold'
- 'Pokémon Silver'
- 'Pokémon Crystal'
- 'Pokémon Ruby'
- 'Pokémon Sapphire'
- 'Pokémon FireRed'
- 'Pokémon LeafGreen'
- 'Pokémon Emerald'
- 'Pokémon Diamond'
- 'Pokémon Pearl'
- 'Pokémon Platinum'
- 'Pokémon HeartGold'
- 'Pokémon SoulSilver'
- 'Pokémon Black'
- 'Pokémon White'
- 'Pokémon Black 2'
- 'Pokémon White 2'
- 'Pokémon X'
- 'Pokémon Y'
- 'Pokémon Omega Ruby'
- 'Pokémon Alpha Sapphire'
- 'Pokémon Sun'
- 'Pokémon Moon'
- 'Pokémon Ultra Sun'
- 'Pokémon Ultra Moon'
- "Pokémon: Let's Go Pikachu!"
- "Pokémon: Let's Go Eevee!"
- 'Pokémon Sword'
- 'Pokémon Shield'
- 'Doom'
- 'Doom II'
- 'Doom 3: BFG'
- 'Quake'
- 'Wolfenstein 3D'
- 'Wolfenstein: The New Order'
- 'Wolfenstein: The Old Blood'
- 'Wolfenstein 2: The New Colossus'
- 'Puyo Puyo Tetris'
- 'Katamari Damacy'
- 'Bastion'
- 'Transistor'
- 'System Shock'
- 'BioShock'
- 'BioShock Infinite'
- 'Deus Ex'
- 'Metroid Prime'
- 'Metroid Prime 2: Echoes'
- 'Metroid Prime 3: Corruption'
- 'Super Meat Boy'
- 'Super Smash Bros. Brawl'
- 'Super Smash Bros. Melee'
- 'Super Smash Bros. Ultimate'
- 'Thief II'
- 'Vampire: The Masquerade – Bloodlines'
- 'Myst'
- 'Batman: Arkham Asylum'
- 'Batman: Arkham City'
- 'Dishonored'
- 'God of War'
- 'LittleBigPlanet'
- 'Grim Fandango'
- 'Day of the Tentacle'
- 'Kingdom Hearts'
- 'Kingdom Hearts II'
- 'The Last of Us'
- 'Perfect Dark'
- 'Shadow of the Colossus'
- 'Fallout: New Vegas'
- 'Fire Emblem Awakening'
- "Banjo-Kazooie: Grunty's Revenge"
- 'Banjo-Kazooie: Nuts & Bolts'
- 'Firewatch'
- 'Mass Effect'
- 'Mass Effect 2'
- 'Mass Effect 3'
- 'Mega Man'
- 'Mega Man Battle Network'
- 'Bayonetta'
- 'Bayonetta 2'
- 'The Wonderful 101'
- 'Sleeping Dogs'
- 'Battletoads'
- 'Brütal Legend'
- 'Halo Wars'
- 'Clannad'
- 'Highway Blossoms'
- 'Infamous'
- 'Crash Bandicoot'
- 'Just Cause'
- 'Just Cause 2'
- 'Devil May Cry'
- 'Life is Strange'
- 'WarioWare: Smooth Moves'
- 'WarioWare: Touched!'
- 'Dwarf Fortress'
- 'Dungeon Keeper'
- 'Minecraft'
- 'Fortnite'
- "PlayerUnknown's Battlegrounds"
- "Kirby's Adventure"
- "Kirby's Dream Land"
- "Kirby's Epic Yarn"
- "Yoshi's Wooly World"
- 'L.A. Noire'
- 'Kid Icarus'
- 'Ice Climbers'
- 'Crysis'
- 'Crysis 2'
- 'Hitman: Absolution'
- 'Metal Gear Solid'
- 'F-Zero'
- 'F.E.A.R.'
- 'Max Payne'
- 'Max Payne 2: The Fall of Max Payne'
- 'Max Payne 3'
- 'Far Cry'
- 'Castle Crashers'
- 'Sonic Unleashed'
- "Mirror's Edge"
- 'The Witcher'
- 'The Witcher 2: Assassins of Kings'
- 'The Witcher 3: Wild Hunt'
- 'Monster Hunter: World'
genre:
- 'First-person shooter'
- 'Puzzle'
- 'Platformer'
- 'Action'
- 'Adventure'
- 'Strategy'
- 'Role-playing game'
- 'Sports'
- 'Simulation'
- 'Fighting'
- 'Massively multiplayer online'
- 'Stealth'
- 'Survival'
- 'Rhythm'
- 'Survival horror'
- 'Text adventure'
- 'Visual novel'
- 'Real-time strategy'
- 'Multiplayer online battle arena'
- 'Tower defense'
- 'Trivia'
platform:
- 'Xbox'
- 'Xbox 360'
- 'Xbox One'
- 'PlayStation'
- 'PlayStation 2'
- 'PlayStation 3'
- 'PlayStation 4'
- 'PlayStation Portable'
- 'PlayStation Vita'
- 'Game Boy'
- 'Game Boy Color'
- 'Game Boy Advance'
- 'Nintendo DS'
- 'Nintendo DSi'
- 'Nintendo 3DS'
- 'Nintendo Entertainment System'
- 'Super Nintendo Entertainment System'
- 'Nintendo 64'
- 'GameCube'
- 'Wii'
- 'Wii U'
- 'Nintendo Switch'
- 'Windows'
- 'macOS'
- 'Linux'
- 'Sega Genesis'
- 'Sega Master System'
- 'Game Gear'
- 'Sega Saturn'
- 'Sega Dreamcast'
- 'Virtual Boy'
21 changes: 21 additions & 0 deletions test/faker/games/test_game.rb
@@ -0,0 +1,21 @@
# frozen_string_literal: true

require_relative '../../test_helper'

class TestFakerGame < Test::Unit::TestCase
def setup
@tester = Faker::Game
end

def test_title
assert @tester.title.match(/\w+/)
end

def test_genre
assert @tester.genre.match(/\w+/)
end

def test_platform
assert @tester.platform.match(/\w+/)
end
end
1 change: 1 addition & 0 deletions unreleased_README.md
Expand Up @@ -231,6 +231,7 @@ gem 'faker', :git => 'https://github.com/stympy/faker.git', :branch => 'master'
- [Faker::Creature::Horse](doc/unreleased/creature/horse.md)

### Games
- [Faker::Game](doc/games/game.md)
- [Faker::Games::Dota](doc/unreleased/games/dota.md)
- [Faker::Games::ElderScrolls](doc/unreleased/games/elder_scrolls.md)
- [Faker::Games::Fallout](doc/unreleased/games/fallout.md)
Expand Down

0 comments on commit 9b97b52

Please sign in to comment.