-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add The Kingkiller Chronicle (#2395)
- Loading branch information
Showing
5 changed files
with
158 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Faker::Books::TheKingkillerChronicle | ||
|
||
```ruby | ||
# Random The Kingkiller Chronicle book | ||
Faker::Books::TheKingkillerChronicle.book #=> "The Name of the Wind" | ||
|
||
# Random The Kingkiller Chronicle character | ||
Faker::Books::TheKingkillerChronicle.character #=> "Kvothe" | ||
|
||
# Random The Kingkiller Chronicle creature | ||
Faker::Books::TheKingkillerChronicle.creature #=> "Scrael" | ||
|
||
# Random The Kingkiller Chronicle location | ||
Faker::Books::TheKingkillerChronicle.location #=> "Tarbean" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class Books | ||
class TheKingkillerChronicle < Base | ||
class << self | ||
## | ||
# Produces the name of a The Kingkiller Chronicle book. | ||
# | ||
# @return [String] | ||
# | ||
# @example | ||
# Faker::Books::TheKingkillerChronicle.book #=> "The Name of the Wind" | ||
# | ||
# @faker.version next | ||
def book | ||
fetch('books.the_kingkiller_chronicle.books') | ||
end | ||
|
||
## | ||
# Produces the name of a The Kingkiller Chronicle character. | ||
# | ||
# @return [String] | ||
# | ||
# @example | ||
# Faker::Books::TheKingkillerChronicle.character #=> "Kvothe" | ||
# | ||
# @faker.version next | ||
def character | ||
fetch('books.the_kingkiller_chronicle.characters') | ||
end | ||
|
||
## | ||
# Produces the name of a The Kingkiller Chronicle creature. | ||
# | ||
# @return [String] | ||
# | ||
# @example | ||
# Faker::Books::TheKingkillerChronicle.creature #=> "Scrael" | ||
# | ||
# @faker.version next | ||
def creature | ||
fetch('books.the_kingkiller_chronicle.creatures') | ||
end | ||
|
||
## | ||
# Produces the name of a The Kingkiller Chronicle location. | ||
# | ||
# @return [String] | ||
# | ||
# @example | ||
# Faker::Books::TheKingkillerChronicle.location #=> "Tarbean" | ||
# | ||
# @faker.version next | ||
def location | ||
fetch('books.the_kingkiller_chronicle.locations') | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
en: | ||
faker: | ||
books: | ||
the_kingkiller_chronicle: | ||
books: | ||
- The Name of the Wind | ||
- The Wise Man's Fear | ||
- The Doors of Stone | ||
characters: | ||
- Abenthy | ||
- Auri | ||
- Bast | ||
- Brandeur | ||
- Bredon | ||
- Cinder | ||
- Denna | ||
- Devi | ||
- Elodin | ||
- Felurian | ||
- Haliax | ||
- Kvothe | ||
- Laurian | ||
- Lanre | ||
- Marten | ||
- Master Ash | ||
- Skarpi | ||
- Shehyn | ||
- Simmon | ||
- Tehlu | ||
- Tempi | ||
- Vashet | ||
- Wilem | ||
creatures: | ||
- Angel | ||
- Demon | ||
- Draccus | ||
- Keth-Selhan | ||
- Scrael | ||
- Sipquick | ||
- Skin dancer | ||
locations: | ||
- Ademre | ||
- Aryen | ||
- Baedn-Bryt | ||
- Crosson | ||
- Eld | ||
- Evesdown | ||
- Hallowfell | ||
- Imre | ||
- Levinshir | ||
- Newarre | ||
- Severen | ||
- Tarbean | ||
- Temerant | ||
- Waystone Inn | ||
- Yll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../../test_helper' | ||
|
||
class TestTheKingkillerChronicle < Test::Unit::TestCase | ||
def setup | ||
@tester = Faker::Books::TheKingkillerChronicle | ||
end | ||
|
||
def test_book | ||
assert @tester.book.match(/\w+/) | ||
end | ||
|
||
def test_character | ||
assert @tester.character.match(/\w+/) | ||
end | ||
|
||
def test_creature | ||
assert @tester.creature.match(/\w+/) | ||
end | ||
|
||
def test_location | ||
assert @tester.location.match(/\w+/) | ||
end | ||
end |