forked from faker-ruby/faker
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes faker-ruby#949
- Loading branch information
Showing
6 changed files
with
181 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::DrWho | ||
|
||
```ruby | ||
Faker::DrWho.character #=> "Captain Jack Harness" | ||
|
||
Faker::DrWho.the_doctor #=> "Ninth Doctor" | ||
|
||
Faker::DrWho.catch_phrase #=> "Fantastic!" | ||
|
||
Faker::DrWho.quote #=> "Lots of planets have a north!" | ||
|
||
Faker::DrWho.villian #=> "The Master" | ||
|
||
Faker::DrWho.specie #=> "Dalek" | ||
``` |
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,34 @@ | ||
#encoding: utf-8 | ||
#frozen_string_literal: true | ||
|
||
module Faker | ||
|
||
class DrWho < Base | ||
|
||
def self.character | ||
fetch('dr_who.character') | ||
end | ||
|
||
def self.the_doctor | ||
fetch('dr_who.the_doctors') | ||
end | ||
|
||
def self.catch_phrase | ||
fetch('dr_who.catch_phrases') | ||
end | ||
|
||
def self.quote | ||
fetch('dr_who.quotes') | ||
end | ||
|
||
def self.villian | ||
fetch('dr_who.villians') | ||
end | ||
|
||
def self.specie | ||
fetch('dr_who.species') | ||
end | ||
|
||
end #class DrWho | ||
|
||
end #module Faker |
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,74 @@ | ||
en: | ||
faker: | ||
dr_who: | ||
character: [ | ||
"Dr. Who", "The Doctor", "Tardis", "Rose Tyler", "Adam Mitchell", "Mickey Smith", "Donna Noble", "Martha Jones", | ||
"Captain Jack Harness", "Astrid Peth", "Sarah Jane Smith", "Jackson Lake", "Lady Christina de Souza", | ||
"Adelaide Brooke", "Wilfred Mott" ] | ||
the_doctors: [ | ||
"First Doctor", "Second Doctor", "Third Doctor", "Fourth Doctor", "Fifth Doctor", "Seventh Doctor", | ||
"Eighth Doctor", "Ninth Doctor", "Tenth Doctor", "Eleventh Doctor", "Twelfth Doctor" | ||
] | ||
catch_phrases: [ | ||
"Fantastic!", "I’m sorry. I’m so sorry.", "Bow ties are cool.", "Mmm I wonder ... Aha!", | ||
"Brave heart, Tegan.", "Would you care for a jelly baby?", "Reverse the polarity of the neutron flow.", | ||
"Somewhere there’s danger, somewhere there’s injustice, somewhere else, the tea’s getting cold.", | ||
"When I say run, run. (pause) RUN!", "Mm? What’s that, my boy?" | ||
] | ||
quotes: [ | ||
"Lots of planets have a north!", | ||
] | ||
villians: [ | ||
"Helen A", "Abzorbaloff", "Animus", "The Master", | ||
] | ||
species: [ | ||
"Time Lord", "Dalek", "Thal", "Dal", "Voord", "Sensorite", "Slyther", "Didonian", "Sand Beast", "Animus", | ||
"Zarbi", "Larvae Gun", "Menoptra", "Morok", "Xeron", "Aridian", "Mire Beast", "Gubbage Cone", "Rill", | ||
"Great Old One", "Drahvin", "Varga Plant", "Representatives of the 7 Galaxies", "Visian", "Screamer", | ||
"Monoid", "Refusian", "Celestial Toymaker", "Elder", "Cybermen (Mondas)", "Fish People", "Macra", | ||
"Chameleon", "Cybermat", "The Moon", "Great Intelligence", "Ice Warrior", "Seaweed Creature", "Dominator", | ||
"Dulcian", "Master Brain", "Land of Fiction beings", "Kroton", "Gond", "Seed Pod", "Auton", "Nestene Consciousness", | ||
"Silurian", "Ambassadors", "Primord", "Keller Machine", "Axos/Axon/Axonite", "Uxariean", "Dæmon", | ||
"Ogron", "Arcturan", "Alpha Centauran", "Aggedor", "Peladonian", "Sea Devil", "Solonian", "Chronovore", | ||
"Minotaur", "Anti-matter organism", "Lurman", "Drashig", "Inter Minorian", "Wallarian", "Draconian", "Spiridon", | ||
"Giant Maggots", "Sontaran", "Dinosaur", "Exxilon", "Eight Legs", "Wirrn", "Kaled", "Vogan", "Zygon", "Skarasen", | ||
"Morestran", "Sutekh", "Osiran", "Kraal", "Sisterhood of Karn", "Hoothi", "Krynoid", "Mandragora Helix", "Kastrian", | ||
"Giant Rat", "Rutan", "Swarm (Virus)", "Fendahl", "Usurian", "Minyan", "Vardan", "Guardian", "Ribosian", | ||
"Levithian", "Shrivenzale", "Zanak Humanoid", "Diplosian", "Ogri", "Megara", "Taran", "Taran Beast", | ||
"Swampie", "Kroll", "The Shadow", "Mute", "Sirian", "Jagaroth", "Chloris Humanoid", "Tythonian", "Wolfweed", | ||
"Mandrel", "Skonnan", "Nimon", "Anethan", "Crinothian", "Drornidian", "Krarg", "Argolin", "Foamasi", | ||
"Tigellan", "Zolfa-Thuran", "Gaztak", "Bell Plant", "Alzarian", "Marshman", "Marshspider", "Great Vampire", | ||
"Tharil", "Trakenite", "Logopolitan", "Castrovalvan", "Urbankan", "Mara", "Kinda", "Terileptil", "Plasmaton", | ||
"Xeraphin", "The Ergon", "Manussan", "Trion", "Garm", "Eternal", "Myrka", "Malus", "Tractator", "Magma Beast", | ||
"Queen Bat", "Gastropod", "Jadondan", "Cryon", "Mentor", "Gee-Jee fly", "Androgum", "Karfelon", "Morlox", | ||
"Bandril", "Andromedan", "Thoros Alphan", "Krontep", "Posicarian", "Raak", "Vervoid", "Mogarian", "Lakertyan", | ||
"Tetrap", "Time Brain", "Chimeron", "Navarino", "Bannermen", "Proamonian", "Dragon", "Stigorax", "Pipe Person", | ||
"Validium", "Gods of Ragnorak", "Werewolf", "The Destroyer", "Light", "Fenric", "Haemovore", "Cheetah People", | ||
"Kitling", "Deathworm Morphant", "Lady Cassandra O'Brien.∆17", "Boekind", "Crespallion", "Trees of Cheem", | ||
"Pakoo", "Balhoonian", "New Human", "Protohuman", "Digihuman", "Gelth", "Raxacoricofallapatorian", | ||
"Space Pig", "Jagrafess", "Reaper", "Empty Child", "Nanogene", "Chula", "Barcelonian Dogs", "Sycorax", | ||
"Graske", "Catkind", "New Human", "Krillitane", "Cyberman (Pete's World)", "The Wire", "The Beast", | ||
"Ood", "Pallushi", "Hoix", "Abzorbaloff", "Isolus", "Flying Stingray", "Weevil", "Sex Gas", "Fairy", | ||
"Arcateenian", "Racnoss", "Dogon", "Abaddon", "Bane", "Xylok", "Judoon", "Plasmavore", "Carrionite", | ||
"Pig Slave", "Dalek/Human Hybrid", "Richard Lazarus", "Torajii Sun", "Family of Blood", "Scarecrow", | ||
"Weeping Angel", "Futurekind", "Malmooth", "Toclafane", "Gorgon", "Uvodni", "The Trickster", "Verron", | ||
"Sto Humanoid", "Zocci", "Blowfish", "Cell 114", "Cash Cow", "Mayfly", "Duroc", "Nostrovite", "Night Travellers", | ||
"Tumor Alien", "Cowled Ghost", "Adipose", "Pyrovile", "Ood Brain", "Hath", "Vespiform", "Vashta Nerada", | ||
"Time Beetle", "Shadow Proclamation Humanoids", "Bees (Melissa Majoria)", "Pied Piper", "Ancient Lights", | ||
"Berserker", "Travist Polong", "Cybershade", "The Swarm", "Tritovore", "Hitchhiker", "The 4-5-6", "Veil", | ||
"Eve", "Jixen", "Erasmus Darkening", "International Gallery Paintings", "The Flood", "Vinvocci", | ||
"Dauntless Prison Inmates", "Korven", "Fear Entity", "Gryffen Family Ghosts", "Bodach", "Anubian", | ||
"Oroborus", "Mede", "Multi-form", "Atraxi", "Aeolian", "Star Whale", "Winder", "Centuripede", "The Hunger", | ||
"Aplan", "Ukkan", "Saturnyn", "Psychic Pollen", "Eknodine", "Etydion", "Krafayis", "Vishklar", "Shansheeth", | ||
"Groske", "Qetesh", "Dark Hoarde", "Chelonian", "Haemogoth", "Sky Fish", "The Silence", "Siren", | ||
"Patchwork Person", "Ganger", "Headless Monk", "Brain Parasite", "Tenza", "Peg Doll", "The Blessing Messenger", | ||
"Apalapucian", "The Blessing", "Tivolian", "Minotaur", "Metalkind", "Fleshkind", "Hetocumtek", "Skullion", | ||
"Androzani Tree", "Dalek Puppet", "Kahler", "Orderly", "Shakri", "Memory Worm", "Snowmen", "Akhaten Humanoid", | ||
"Pan-Babylonian", "Lugal-Irra-Kush", "Lucanian", "Hooloovoo", "Terraberserker", "Ultramancer", "Vigil", | ||
"Crooked Person", "Time Zombie", "Mr. Sweet", "Cybermite", "Whisper Men", "The Teller", "Skovox Blitzer", | ||
"Spider Germ", "The Foretold", "Boneless", "Kantrofarri", "The Fisher King", "The Mire", "Leonian", | ||
"The Sandmen", "Janus", "Quantum Shade", "The Veil", "Hydroflax", "Shoal of the Winter Harmony", "Rhodian", | ||
"Quill", "Shadow Kin", "Arn", "Lothan", "Leaf Dragon", "Lankin", "Killer petals", "Lorr", "Sentient oil", | ||
"Vardy", "Sea Creature", "Lure Fish", "Dryad", "The Monks" | ||
] | ||
|
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,51 @@ | ||
#encoding: utf-8 | ||
#frozen_string_literal: true | ||
|
||
require File.expand_path(File.dirname(__FILE__) + '/test_helper') | ||
|
||
class TestFakerDrWho < Test::Unit::TestCase | ||
|
||
def setup | ||
Faker::Config.locale = nil | ||
end | ||
|
||
|
||
def test_character | ||
10.times { assert Faker::DrWho.character.match(/[\w]+/) } | ||
end | ||
|
||
def test_the_doctor | ||
10.times { assert Faker::DrWho.the_doctor.match(/[\w]+/) } | ||
end | ||
|
||
def test_catch_phrase | ||
10.times { assert Faker::DrWho.catch_phrase.match(/[\w]+/) } | ||
end | ||
|
||
def test_quote | ||
10.times { assert Faker::DrWho.quote.match(/[\w]+/) } | ||
end | ||
|
||
def test_villian | ||
10.times { assert Faker::DrWho.villian.match(/[\w]+/) } | ||
end | ||
|
||
def test_specie | ||
10.times { assert Faker::DrWho.specie.match(/[\w]+/) } | ||
end | ||
|
||
|
||
def test_locales | ||
[nil,'en','de',#... | ||
].each do |locale_name| | ||
Faker::Config.locale = 'de' | ||
assert Faker::DrWho.character .is_a? String | ||
assert Faker::DrWho.the_doctor .is_a? String | ||
assert Faker::DrWho.catch_phrase.is_a? String | ||
assert Faker::DrWho.quote .is_a? String | ||
assert Faker::DrWho.villian .is_a? String | ||
assert Faker::DrWho.specie .is_a? String | ||
end | ||
end | ||
|
||
end #class TestFakerDrWho |