From 0e683904b2d6866c1bec05a53fb01e9a318f1941 Mon Sep 17 00:00:00 2001 From: Marcelo Barreto Date: Tue, 6 Apr 2021 12:05:28 -0300 Subject: [PATCH] Add more methods to the Witcher class (#2295) --- Gemfile.lock | 6 ++-- doc/games/witcher.md | 8 +++++- lib/faker/games/witcher.rb | 39 ++++++++++++++++++++++++++ lib/faker/version.rb | 2 +- lib/locales/en/witcher.yml | 37 ++++++++++++++++++++++++ test/faker/games/test_faker_witcher.rb | 12 ++++++++ 6 files changed, 99 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 169fbc5901..e1935075fc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - faker (2.17.0) + faker (2.18.0) i18n (>= 1.6, < 2) GEM @@ -11,7 +11,7 @@ GEM coderay (1.1.3) concurrent-ruby (1.1.8) docile (1.3.2) - i18n (1.8.9) + i18n (1.8.10) concurrent-ruby (~> 1.0) json (2.3.0) method_source (1.0.0) @@ -65,4 +65,4 @@ DEPENDENCIES yard (= 0.9.26) BUNDLED WITH - 2.1.2 + 2.1.4 diff --git a/doc/games/witcher.md b/doc/games/witcher.md index f3d29d5459..1c7b8e063a 100644 --- a/doc/games/witcher.md +++ b/doc/games/witcher.md @@ -1,7 +1,6 @@ # Faker::Games::Witcher ```ruby - Faker::Games::Witcher.character # => "Triss Merigold" Faker::Games::Witcher.witcher # => "Geralt of Rivia" @@ -13,3 +12,10 @@ Faker::Games::Witcher.school # => "Wolf" Faker::Games::Witcher.quote # => "No Lollygagin'!" Faker::Games::Witcher.monster # => "Katakan" + +Faker::Games::Witcher.sign # => "Igni" + +Faker::Games::Witcher.potion # => "Gadwall" + +Faker::Games::Witcher.book # => "Sword of Destiny" +``` diff --git a/lib/faker/games/witcher.rb b/lib/faker/games/witcher.rb index 71e6c8b7b0..e4760b8670 100644 --- a/lib/faker/games/witcher.rb +++ b/lib/faker/games/witcher.rb @@ -81,6 +81,45 @@ def quote def monster fetch('games.witcher.monsters') end + + ## + # Produces the name of a sign from The Witcher. + # + # @return [String] + # + # @example + # Faker::Games::Witcher.sign #=> "Igni" + # + # @faker.version 2.18.0 + def sign + fetch('games.witcher.signs') + end + + ## + # Produces the name of a potion from The Witcher. + # + # @return [String] + # + # @example + # Faker::Games::Witcher.potion #=> "Gadwall" + # + # @faker.version 2.18.0 + def potion + fetch('games.witcher.potions') + end + + ## + # Produces the name of a book from The Witcher. + # + # @return [String] + # + # @example + # Faker::Games::Witcher.book #=> "Sword of Destiny" + # + # @faker.version 2.18.0 + def book + fetch('games.witcher.books') + end end end end diff --git a/lib/faker/version.rb b/lib/faker/version.rb index d20ec32ae8..6d11b61a12 100644 --- a/lib/faker/version.rb +++ b/lib/faker/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Faker #:nodoc: - VERSION = '2.17.0' + VERSION = '2.18.0' end diff --git a/lib/locales/en/witcher.yml b/lib/locales/en/witcher.yml index 6807abe197..d1cedfca4d 100644 --- a/lib/locales/en/witcher.yml +++ b/lib/locales/en/witcher.yml @@ -391,3 +391,40 @@ en: - Garkain - Higher Vampire - Katakan + signs: + - Aard + - Igni + - Yrden + - Quen + - Axii + - Heliotrop + potions: + - Cat + - Healing brew + - Gadwall + - Tawny Owl + - Wolf + - Rook + - Swallow + - Golden Oriole + - Tiara + - Stammelford's philtre + - Maribor Forest + - Lapwing + - Virga + - White Raffard's Decoction + - Brock + - Petri's Philter + - Thunderbolt + - Mongoose + - Visionary's potion + - Anabolic steroids + books: + - The Last Wish + - Sword of Destiny + - Blood of Elves + - Time of Contempt + - Baptism of Fire + - The Tower of the Swallow + - The Lady of the Lake + - Season of Storms diff --git a/test/faker/games/test_faker_witcher.rb b/test/faker/games/test_faker_witcher.rb index 591526281c..0e4ffe484b 100644 --- a/test/faker/games/test_faker_witcher.rb +++ b/test/faker/games/test_faker_witcher.rb @@ -30,4 +30,16 @@ def test_monster def test_quote assert @witcher.quote.match(/\w+/) end + + def test_sign + assert @witcher.sign.match(/\w+/) + end + + def test_potion + assert @witcher.potion.match(/\w+/) + end + + def test_book + assert @witcher.book.match(/\w+/) + end end