Skip to content

Commit

Permalink
Add Faker::Games::Dota.building. ref: https://dota2.fandom.com/wiki/B…
Browse files Browse the repository at this point in the history
  • Loading branch information
tirasundara committed Jun 22, 2021
1 parent a1f5bde commit c609855
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/faker/games/dota.rb
Expand Up @@ -4,6 +4,19 @@ module Faker
class Games
class Dota < Base
class << self
##
# Produces the name of a building from Dota.
#
# @return [String]
#
# @example
# Faker::Games::Dota.building #=> "Tower"
#
# @faker.version 1.9.0
def building
fetch('games.dota.building')
end

##
# Produces the name of a hero from Dota.
#
Expand Down
7 changes: 7 additions & 0 deletions lib/locales/en/dota.yml
Expand Up @@ -2,6 +2,13 @@ en:
faker:
games:
dota:
building:
- Tower
- Barrack
- Ancient
- Fountain
- Effigy
- Outpost
hero:
- Abaddon
- Alchemist
Expand Down
4 changes: 4 additions & 0 deletions test/faker/games/test_faker_dota.rb
Expand Up @@ -13,6 +13,10 @@ def setup
underlord undying wraith_king]
end

def test_building
assert @tester.building.match(/\w+/)
end

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

0 comments on commit c609855

Please sign in to comment.