Skip to content

Commit

Permalink
Add more methods to the Witcher class (#2295)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelobarreto committed Apr 6, 2021
1 parent 08cd44c commit 0e68390
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
faker (2.17.0)
faker (2.18.0)
i18n (>= 1.6, < 2)

GEM
Expand All @@ -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)
Expand Down Expand Up @@ -65,4 +65,4 @@ DEPENDENCIES
yard (= 0.9.26)

BUNDLED WITH
2.1.2
2.1.4
8 changes: 7 additions & 1 deletion 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"
Expand All @@ -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"
```
39 changes: 39 additions & 0 deletions lib/faker/games/witcher.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/faker/version.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Faker #:nodoc:
VERSION = '2.17.0'
VERSION = '2.18.0'
end
37 changes: 37 additions & 0 deletions lib/locales/en/witcher.yml
Expand Up @@ -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
12 changes: 12 additions & 0 deletions test/faker/games/test_faker_witcher.rb
Expand Up @@ -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

0 comments on commit 0e68390

Please sign in to comment.