Skip to content

Commit

Permalink
Add The Kingkiller Chronicle (#2395)
Browse files Browse the repository at this point in the history
  • Loading branch information
fblupi authored Oct 1, 2021
1 parent 09f5c3b commit 92f0e15
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
- [Faker::Books::CultureSeries](doc/books/culture_series.md)
- [Faker::Books::Dune](doc/books/dune.md)
- [Faker::Books::Lovecraft](doc/books/lovecraft.md)
- [Faker::Books::TheKingkillerChronicle](doc/books/the_kingkiller_chronicle.md)

### Fantasy
- [Faker::Fantasy::Tolkien](doc/fantasy/tolkien.md)
Expand Down
15 changes: 15 additions & 0 deletions doc/books/the_kingkiller_chronicle.md
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"
```
61 changes: 61 additions & 0 deletions lib/faker/books/the_kingkiller_chronicle.rb
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
56 changes: 56 additions & 0 deletions lib/locales/en/the_kingkiller_chronicle.yml
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
25 changes: 25 additions & 0 deletions test/faker/books/test_the_kingkiller_chronicle.rb
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

0 comments on commit 92f0e15

Please sign in to comment.