Skip to content

Commit

Permalink
Add Faker::Overwatch (faker-ruby#857)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdracz authored and stympy committed Mar 21, 2017
1 parent 210ba3a commit 1016095
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Contents
- [Faker::Name](doc/name.md)
- [Faker::Number](doc/number.md)
- [Faker::Omniauth](doc/omniauth.md)
- [Faker::Overwatch](doc/overwatch.md)
- [Faker::PhoneNumber](doc/phone_number.md)
- [Faker::Placeholdit](doc/placeholdit.md)
- [Faker::Pokemon](doc/pokemon.md)
Expand Down
9 changes: 9 additions & 0 deletions doc/overwatch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Faker::Overwatch

```ruby
Faker::Overwatch.hero #=> "Tracer"

Faker::Overwatch.location #=> "Numbani"

Faker::Overwatch.quote #=> "It's high noon"
```
17 changes: 17 additions & 0 deletions lib/faker/overwatch.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module Faker
class Overwatch < Base
class << self
def hero
fetch('overwatch.heroes')
end

def location
fetch('overwatch.locations')
end

def quote
fetch('overwatch.quotes')
end
end
end
end
30 changes: 30 additions & 0 deletions lib/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -606,3 +606,33 @@ en:
markdown:
headers: ["#", "##", "###", "####", "#####", "######"]
emphasis: ["_", "~", "*", "**"]
overwatch:
heroes: ["Ana", "Bastion", "D.va", "Genji", "Hanzo", "Junkrat", "Lucio", "McCree", "Mei", "Mercy", "Orisa", "Pharah", "Reaper", "Reinhardt", "Roadhog", "Soldier 76", "Sombra", "Symmetra", "Torbjorn", "Tracer", "Widowmaker", "Winston", "Zarya", "Zenyatta"]
locations: ["Adlersbrunn", "Dorado", "Ecopoint: Antarctica", "Eichenwalde", "Hanamura", "Hollywood", "Ilios", "King's Row", "Lijiang Tower", "Nepal", "Numbani", "Oasis", "Route 66", "Temple of Anubis", "Volskaya Industries", "Watchpoint: Gibraltar"]
quotes: [
"It's high noon",
"Pass into the Iris",
"Heroes never die",
"Fire at will",
"Hammer Down!",
"Molten Core!",
"No one can hide from my sight",
"Time's up",
"Ryuugekiken",
"Ryuu-ga Wa-ga-te-ki-wo Ku-ra-u",
"I've got you in my sights",
"Die! Die! Die!",
"Justice rains from above",
"Fire in the hole!",
"Nerf This!",
"Boo boo doo de doo.",
"Hack the planet",
"Love, D.va",
"Justice ain't gonna dispense itself",
"Be sure to stretch before engaging in rigorous physical activity",
"Overconfidence is a flimsy shield",
"Repetition is the path to mastery",
"I am on fire, but an extinguisher is not required",
"I'm the one who does his job. I'm thinking, you're the other one",
"You're just a glitch in the system"
]
19 changes: 19 additions & 0 deletions test/test_faker_overwatch.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb')

class TestFakerOverwatch < Test::Unit::TestCase
def setup
@tester = Faker::Overwatch
end

def test_hero
assert @tester.hero.match(/\w+/)
end

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

def test_quote
assert @tester.quote.match(/\w+/)
end
end

0 comments on commit 1016095

Please sign in to comment.