Skip to content

Commit 0e68390

Browse files
Add more methods to the Witcher class (faker-ruby#2295)
1 parent 08cd44c commit 0e68390

File tree

6 files changed

+99
-5
lines changed

6 files changed

+99
-5
lines changed

Gemfile.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
faker (2.17.0)
4+
faker (2.18.0)
55
i18n (>= 1.6, < 2)
66

77
GEM
@@ -11,7 +11,7 @@ GEM
1111
coderay (1.1.3)
1212
concurrent-ruby (1.1.8)
1313
docile (1.3.2)
14-
i18n (1.8.9)
14+
i18n (1.8.10)
1515
concurrent-ruby (~> 1.0)
1616
json (2.3.0)
1717
method_source (1.0.0)
@@ -65,4 +65,4 @@ DEPENDENCIES
6565
yard (= 0.9.26)
6666

6767
BUNDLED WITH
68-
2.1.2
68+
2.1.4

doc/games/witcher.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Faker::Games::Witcher
22

33
```ruby
4-
54
Faker::Games::Witcher.character # => "Triss Merigold"
65

76
Faker::Games::Witcher.witcher # => "Geralt of Rivia"
@@ -13,3 +12,10 @@ Faker::Games::Witcher.school # => "Wolf"
1312
Faker::Games::Witcher.quote # => "No Lollygagin'!"
1413

1514
Faker::Games::Witcher.monster # => "Katakan"
15+
16+
Faker::Games::Witcher.sign # => "Igni"
17+
18+
Faker::Games::Witcher.potion # => "Gadwall"
19+
20+
Faker::Games::Witcher.book # => "Sword of Destiny"
21+
```

lib/faker/games/witcher.rb

+39
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,45 @@ def quote
8181
def monster
8282
fetch('games.witcher.monsters')
8383
end
84+
85+
##
86+
# Produces the name of a sign from The Witcher.
87+
#
88+
# @return [String]
89+
#
90+
# @example
91+
# Faker::Games::Witcher.sign #=> "Igni"
92+
#
93+
# @faker.version 2.18.0
94+
def sign
95+
fetch('games.witcher.signs')
96+
end
97+
98+
##
99+
# Produces the name of a potion from The Witcher.
100+
#
101+
# @return [String]
102+
#
103+
# @example
104+
# Faker::Games::Witcher.potion #=> "Gadwall"
105+
#
106+
# @faker.version 2.18.0
107+
def potion
108+
fetch('games.witcher.potions')
109+
end
110+
111+
##
112+
# Produces the name of a book from The Witcher.
113+
#
114+
# @return [String]
115+
#
116+
# @example
117+
# Faker::Games::Witcher.book #=> "Sword of Destiny"
118+
#
119+
# @faker.version 2.18.0
120+
def book
121+
fetch('games.witcher.books')
122+
end
84123
end
85124
end
86125
end

lib/faker/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module Faker #:nodoc:
4-
VERSION = '2.17.0'
4+
VERSION = '2.18.0'
55
end

lib/locales/en/witcher.yml

+37
Original file line numberDiff line numberDiff line change
@@ -391,3 +391,40 @@ en:
391391
- Garkain
392392
- Higher Vampire
393393
- Katakan
394+
signs:
395+
- Aard
396+
- Igni
397+
- Yrden
398+
- Quen
399+
- Axii
400+
- Heliotrop
401+
potions:
402+
- Cat
403+
- Healing brew
404+
- Gadwall
405+
- Tawny Owl
406+
- Wolf
407+
- Rook
408+
- Swallow
409+
- Golden Oriole
410+
- Tiara
411+
- Stammelford's philtre
412+
- Maribor Forest
413+
- Lapwing
414+
- Virga
415+
- White Raffard's Decoction
416+
- Brock
417+
- Petri's Philter
418+
- Thunderbolt
419+
- Mongoose
420+
- Visionary's potion
421+
- Anabolic steroids
422+
books:
423+
- The Last Wish
424+
- Sword of Destiny
425+
- Blood of Elves
426+
- Time of Contempt
427+
- Baptism of Fire
428+
- The Tower of the Swallow
429+
- The Lady of the Lake
430+
- Season of Storms

test/faker/games/test_faker_witcher.rb

+12
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,16 @@ def test_monster
3030
def test_quote
3131
assert @witcher.quote.match(/\w+/)
3232
end
33+
34+
def test_sign
35+
assert @witcher.sign.match(/\w+/)
36+
end
37+
38+
def test_potion
39+
assert @witcher.potion.match(/\w+/)
40+
end
41+
42+
def test_book
43+
assert @witcher.book.match(/\w+/)
44+
end
3345
end

0 commit comments

Comments
 (0)