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::Games::HalfLife #1381

Merged
merged 5 commits into from
Oct 4, 2018
Merged
Show file tree
Hide file tree
Changes from 4 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
14 changes: 14 additions & 0 deletions doc/half_life.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Faker::HalfLife

It might be available in the next version.

```ruby
# Any character from the game
Faker::HalfLife.character #=> "Gordon Freeman"

# Any enemy from the game
Faker::HalfLife.enemy #=> "Houndeye"

# Any location from the game
Faker::HalfLife.location #=> "Black Mesa Research Facility"
```
19 changes: 19 additions & 0 deletions lib/faker/half_life.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

module Faker
class HalfLife < Base
class << self
def character
fetch('half_life.character')
end

def enemy
fetch('half_life.enemy')
end

def location
fetch('half_life.location')
end
end
end
end
6 changes: 6 additions & 0 deletions lib/locales/en/half_life.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
en:
faker:
half_life:
character: ["Adrian Shephard", "Alyx Vance", "Arne Magnusson", "Barney Calhoun", "Colette Green", "Dog", "Eli Vance", "Father Grigori", "G-Man", "Gina Cross", "Gordon Freeman", "Isaac Kleiner", "Judith Mossman", "Odessa Cubbage", "Richard Keller", "Simmons", "Wallace Breen", "Walter Bennet"]
enemy: ["APC", "Alien Controller", "Alien Grunt", "Antlion", "Antlion Guard", "Assassin", "Baby Headcrab", "Barnacle", "Bullsquid", "City Scanner", "Civil Protection", "Combine Advisor", "Combine Gunship", "Crab Synth", "Fast Headcrab", "Fast Zombie", "Garg", "Gene Worm", "Gonarch", "Grunt", "Headcrab", "Hopper Mine", "Houndeye", "Hunter-Chopper", "Ichthyosaur", "Leech", "Manhack", "Mortar Synth", "Overwatch Elite", "Overwatch Sniper", "Overwatch Soldier", "Pit Drone", "Pit Worm", "Poison Headcrab", "Poison Zombie", "Rollermine", "Shield Scanner", "Shock Roach", "Shock Trooper", "Snark", "Strider", "Tentacle", "Voltigore", "Vortigaunt", "Zombie"]
location: ["Black Mesa East", "Black Mesa Research Facility", "Citadel", "City 17", "Earth", "Nova Prospekt", "Ravenholm", "Section A-17 Prototype Labs", "Sector A Training Facility", "Sector B Coolant Reserve", "Sector C Test Labs", "Sector D Administration", "Sector E Biodome Complex", "Sector F Lambda Complex", "Sector G Hydro Electric", "St. Olga", "White Forest", "Xen"]
21 changes: 21 additions & 0 deletions test/test_half_life.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

require_relative 'test_helper'

class TestFakerHalfLife < Test::Unit::TestCase
def setup
@tester = Faker::HalfLife
end

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

def test_enemy
assert @tester.enemy.match(/\w+/)
end

def test_location
assert @tester.location.match(/\w+/)
end
end