Skip to content

Commit

Permalink
Add Faker::Cosmere (#1115)
Browse files Browse the repository at this point in the history
  • Loading branch information
JauntyJames authored and vbrazo committed Jul 12, 2018
1 parent cfe998c commit 8568945
Show file tree
Hide file tree
Showing 5 changed files with 170 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Contents
- [Faker::Community](doc/community.md)
- [Faker::Company](doc/company.md)
- [Faker::Compass](doc/compass.md)
- [Faker::Cosmere](doc/cosmere.md)
- [Faker::Crypto](doc/crypto.md)
- [Faker::Currency](doc/currency.md)
- [Faker::Date](doc/date.md)
Expand Down
23 changes: 23 additions & 0 deletions doc/cosmere.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Faker::Cosmere

```ruby
Faker::Cosmere.aon #=> "Rao"

Faker::Cosmere.shard_world #=> "Yolen"

Faker::Cosmere.shard #=> "Ambition"

Faker::Cosmere.surge #=> "Progression"

Faker::Cosmere.knight_radiant #=> "Truthwatcher"

Faker::Cosmere.metal #=> "Brass"

Faker::Cosmere.allomancer #=> "Coinshot"

Faker::Cosmere.feruchemist #=> "Archivist"

Faker::Cosmere.herald #=> "Ishar"

Faker::Cosmere.spren #=> "Flamespren"
```
46 changes: 46 additions & 0 deletions lib/faker/cosmere.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
module Faker
class Cosmere < Base
flexible :cosmere
class << self
def aon
sample(aons)
end

def shard_world
sample(shard_worlds)
end

def shard
sample(shards)
end

def surge
sample(surges)
end

def knight_radiant
sample(knights_radiant)
end

def metal
sample(metals)
end

def allomancer
sample(allomancers)
end

def feruchemist
sample(feruchemists)
end

def herald
sample(heralds)
end

def spren
sample(sprens)
end
end
end
end
57 changes: 57 additions & 0 deletions lib/locales/en/cosmere.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
en:
faker:
cosmere:
aons: [
'Aon', 'Aan', 'Aeo', 'Aha', 'Ake', 'Ala', 'Aor', 'Are', 'Ashe', 'Ata',
'Ate', 'Ati', 'Ato', 'Daa', 'Dao', 'Dii', 'Dio', 'Eda', 'Edo', 'Ehe',
'Ela', 'Ena', 'Ene', 'Eno', 'Eon', 'Eshe', 'Eto', 'Iad', 'Ido', 'Ien',
'Iir', 'Ire', 'Kaa', 'Kae', 'Kai', 'Kie', 'Kii', 'Mae', 'Mai', 'Mea',
'Nae', 'Oed', 'Omi', 'Opa', 'Ope', 'Ore', 'Rao', 'Reo', 'Rii', 'Sao',
'Sea', 'Seo', 'Shao', 'Sheo', 'Soi', 'Tae', 'Tia', 'Tii', 'Toa'
]
shard_worlds: [
'Ashyn', 'Braize', 'First of the Sun', 'Nalthis', 'Obrodai', 'Roshar',
'Scadrial', 'Sel', 'Taldain', 'Threnody', 'Vax', 'Yolen'
]
shards: [
'Devotion', 'Dominion', 'Preservation', 'Ruin', 'Odium', 'Cultivation',
'Honor', 'Endowment', 'Autonomy', 'Ambition', 'Harmony'
]
surges: [
'Abrasion', 'Adhesion', 'Cohesion', 'Division', 'Gravitation',
'Illumination', 'Progression', 'Transformation', 'Transportation', 'Tension'
]
knights_radiant: [
'Bondsmith', 'Dustbringer', 'Edgedancer', 'Elsecaller', 'Lightweaver',
'Skybreaker', 'Stoneward', 'Truthwatcher', 'Willshaper', 'Windrunner'
]
metals: [
'Steel', 'Iron', 'Pewter', 'Tin', 'Zinc', 'Brass', 'Copper', Bronze',
'Duralumin', 'Aluminum', 'Nicrosil', 'Chromium', 'Gold', 'Electrum',
'Cadmium', 'Bendalloy', 'Atium', 'Lerasium', 'Ettmetal', 'Malatium'
]
allomancers: [
'Mistborn', 'Coinshot', 'Lurcher', 'Pewterarm', 'Tineye', 'Rioter',
'Soother', 'Smoker', 'Seeker', 'Duralumin Gnat', 'Aluminum Gnat',
'Nicroburst', 'Leecher', 'Augur', 'Oracle', 'Pulser', 'Slider', 'Seer'
]
feruchemists: [
'Feruchemist', 'Skimmer', 'Steelrunner', 'Windwhisper', 'Brute', 'Sparker',
'Firesoul', 'Archivist', 'Sentry', 'Spinner', 'Soulbearer', 'Trueself',
'Connector', 'Gasper', 'Subsumer', 'Bloodmaker', 'Pinnacle'
]
heralds: [
'Jezrien', 'Nale', 'Chanarach', 'Vedel', 'Pailiah', 'Shalash', 'Battar',
'Kalak', 'Talanel', 'Ishar'
]
sprens: [
'Alespren', 'Angerspren', 'Anticipationspren', 'Awespren', 'Bindspren',
'Captivityspren', 'Coldspren', 'Concentrationspren', 'Creationspren',
'Cryptic', 'Cultivationspren', 'Deathspren', 'Decayspren', 'Exhaustionspren',
'Fearspren', 'Flamespren', 'Gloomspren', 'Gloryspren', 'Gravityspren',
'Groundspren', 'Heatspren', 'Highspren', 'Honorspren', 'Hungerspren',
'Inkspren', 'Joyspren', 'Keenspren', 'Laughterspren', 'Liespren',
'Lifespren', 'Logicspren', 'Luckspren', 'Mistspren', 'Musicspren',
'Painspren', 'Passionspren', 'Rainspren', 'Riverspren', 'Rotspren',
'Shamespren', 'Shockspren', 'Stormspren'
]
43 changes: 43 additions & 0 deletions test/test_faker_cosmere.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb')

class TestFakerCosmere < Test::Unit::TestCase
def setup
@tester = Faker::Cosmere
end

def test_aon
assert @tester.aon.match(/\w+\.?/)
end

def test_shard_world
assert @tester.shard_world.match(/\w+\.?/)
end

def test_shard
assert @tester.shard.match(/\w+\.?/)
end

def test_surge
assert @tester.surge.match(/\w+\.?/)
end

def test_knight_radiant
assert @tester.knight_radiant.match(/\w+\.?/)
end

def test_metal
assert @tester.metal.match(/\w+\.?/)
end

def test_allomancer
assert @tester.allomancer.match(/\w+\.?/)
end

def test_herald
assert @tester.herald.match(/\w+\.?/)
end

def test_spren
assert @tester.spren.match(/\w+\.?/)
end
end

0 comments on commit 8568945

Please sign in to comment.