From c609855aa25adb4ac10c0a069c5ea637d9a75288 Mon Sep 17 00:00:00 2001 From: Tira Sundara <31722491+tirasundara@users.noreply.github.com> Date: Tue, 22 Jun 2021 14:53:13 +0700 Subject: [PATCH] Add Faker::Games::Dota.building. ref: https://dota2.fandom.com/wiki/Buildings (#2318) --- lib/faker/games/dota.rb | 13 +++++++++++++ lib/locales/en/dota.yml | 7 +++++++ test/faker/games/test_faker_dota.rb | 4 ++++ 3 files changed, 24 insertions(+) diff --git a/lib/faker/games/dota.rb b/lib/faker/games/dota.rb index 267e0a58d0..3aeb066c98 100644 --- a/lib/faker/games/dota.rb +++ b/lib/faker/games/dota.rb @@ -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. # diff --git a/lib/locales/en/dota.yml b/lib/locales/en/dota.yml index 485bfab125..5cd4bd4ea6 100644 --- a/lib/locales/en/dota.yml +++ b/lib/locales/en/dota.yml @@ -2,6 +2,13 @@ en: faker: games: dota: + building: + - Tower + - Barrack + - Ancient + - Fountain + - Effigy + - Outpost hero: - Abaddon - Alchemist diff --git a/test/faker/games/test_faker_dota.rb b/test/faker/games/test_faker_dota.rb index 8aab513df6..e3bc56f913 100644 --- a/test/faker/games/test_faker_dota.rb +++ b/test/faker/games/test_faker_dota.rb @@ -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