diff --git a/README.md b/README.md index 9dd2f95c6d..a3553dcdcb 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ Contents - [Faker::Music](#fakermusic) - [Faker::Vehicle](#fakervehicle) - [Faker::GameOfThrones](#fakergameofthrones) + - [Faker::Pokemon](#pokemon) - [Customization](#customization) - [Contributing](#contributing) - [Contact](#contact) @@ -852,6 +853,15 @@ Faker::GameOfThrones.house #=> "Stark" Faker::GameOfThrones.city #=> "Lannisport" ``` +###Faker::Pokemon +---------------- + +```ruby +Faker::Pokemon.name #=> "Pikachu" + +Faker::Pokemon.location #=> "Pallet Town" +``` + Customization ------------ Since you may want to make addresses and other types of data look different diff --git a/lib/faker.rb b/lib/faker.rb index 4534780938..48a4449b1a 100644 --- a/lib/faker.rb +++ b/lib/faker.rb @@ -228,6 +228,7 @@ def rand_in_range(from, to) require 'faker/music' require 'faker/vehicle' require 'faker/game_of_thrones' +require 'faker/pokemon' require 'extensions/array' require 'extensions/symbol' diff --git a/lib/faker/pokemon.rb b/lib/faker/pokemon.rb new file mode 100644 index 0000000000..a16f9ab6e0 --- /dev/null +++ b/lib/faker/pokemon.rb @@ -0,0 +1,13 @@ +module Faker + class Pokemon < Base + class << self + def name + fetch('pokemon.names') + end + + def location + fetch('pokemon.locations') + end + end + end +end \ No newline at end of file diff --git a/lib/locales/en.yml b/lib/locales/en.yml index eff63dcc3a..12437c484c 100644 --- a/lib/locales/en.yml +++ b/lib/locales/en.yml @@ -418,3 +418,6 @@ en: characters: ['Daenerys Targaryen', 'Jon Snow', 'Arya Stark', 'Gregor Clegane', 'Melisandre', 'Tyrion Lannister', 'Jaime Lannister', 'Cersei Lannister', 'Petyr Baelish', 'Jorah Mormont', 'Sansa Stark', 'Theon Greyjoy', 'Bran Stark', 'Sandor Clegane', 'Joffrey Baratheon', 'Catelyn Stark', 'Robb Stark', 'Ned Stark', 'Robert Baratheon', 'Viserys Targaryen', 'Varys', 'Samwell Tarly', 'Bronn', 'Tywin Lannister', 'Jeor Mormont', 'Shae', 'Gendry', 'Tommen Baratheon', "Jaqen H'ghar", 'Khal Drogo', 'Davos Seaworth', 'Margaery Tyrell', 'Stannis Baratheon', 'Ygritte', 'Brienne of Tarth', 'Roose Bolton', 'Ramsay Bolton'] houses: ['Arryn', 'Baratheon', 'Bolton', 'Frey', 'Greyjoy', 'Lannister', 'Martell', 'Stark', 'Targaryen', 'Tully', 'Tyrell'] cities: ['Braavos', "King's Landing", 'Volantis', 'Qarth', 'Asshai', 'Old Valyria', 'Meereen', 'Oldtown', 'Pentos', 'Astapor', 'Yunkai', 'Lorath', 'Lys', 'Vaes Dothrak', 'Sunspear', 'White Harbor', 'Myr', 'Lannisport', 'Qohor', 'Tyrosh', 'Norvos', 'Gulltown', 'Old Ghis', 'New Ghis', 'Mantarys', 'Bayasabhad', 'Elyria', 'Tolos', 'Samyrian', 'Chroyane', 'Tyria', 'Oros', 'Bhorash', 'Ny Sar', 'Sar Meel', 'Ar Noy'] + pokemon: + names: ["Bulbasaur", "Ivysaur", "Venusaur", "Charmander", "Charmeleon", "Charizard", "Squirtle", "Wartortle", "Blastoise", "Caterpie", "Metapod", "Butterfree", "Weedle", "Kakuna", "Beedrill", "Pidgey", "Pidgeotto", "Pidgeot", "Rattata", "Raticate", "Spearow", "Fearow", "Ekans", "Arbok", "Pikachu", "Raichu", "Sandshrew", "Sandslash", "Nidoran", "Nidorina", "Nidoqueen", "Nidoran", "Nidorino", "Nidoking", "Clefairy", "Clefable", "Vulpix", "Ninetales", "Jigglypuff", "Wigglytuff", "Zubat", "Golbat", "Oddish", "Gloom", "Vileplume", "Paras", "Parasect", "Venonat", "Venomoth", "Diglett", "Dugtrio", "Meowth", "Persian", "Psyduck", "Golduck", "Mankey", "Primeape", "Growlithe", "Arcanine", "Poliwag", "Poliwhirl", "Poliwrath", "Abra", "Kadabra", "Alakazam", "Machop", "Machoke", "Machamp", "Bellsprout", "Weepinbell", "Victreebel", "Tentacool", "Tentacruel", "Geodude", "Graveler", "Golem", "Ponyta", "Rapidash", "Slowpoke", "Slowbro", "Magnemite", "Magneton", "Farfetch'd", "Doduo", "Dodrio", "Seel", "Dewgong", "Grimer", "Muk", "Shellder", "Cloyster", "Gastly", "Haunter", "Gengar", "Onix", "Drowzee", "Hypno", "Krabby", "Kingler", "Voltorb", "Electrode", "Exeggcute", "Exeggutor", "Cubone", "Marowak", "Hitmonlee", "Hitmonchan", "Lickitung", "Koffing", "Weezing", "Rhyhorn", "Rhydon", "Chansey", "Tangela", "Kangaskhan", "Horsea", "Seadra", "Goldeen", "Seaking", "Staryu", "Starmie", "Mr.", "Scyther", "Jynx", "Electabuzz", "Magmar", "Pinsir", "Tauros", "Magikarp", "Gyarados", "Lapras", "Ditto", "Eevee", "Vaporeon", "Jolteon", "Flareon", "Porygon", "Omanyte", "Omastar", "Kabuto", "Kabutops", "Aerodactyl", "Snorlax", "Articuno", "Zapdos", "Moltres", "Dratini", "Dragonair", "Dragonite", "Mewtwo"] + locations: ["Accumula Town", "Ambrette Town", "Anistar City", "Anville Town", "Aquacorde Town", "Aspertia City", "Azalea Town", "Black City", "Blackthorn City", "Camphrier Town", "Canalave City", "Castelia City", "Celadon City", "Celestic Town", "Cerulean City", "Cherrygrove City", "Cianwood City", "Cinnabar Island", nil, "Coumarine City", "Couriway Town", "Cyllage City", "Dendemille Town", "Dewford Town", "Driftveil City", "Ecruteak City", "Eterna City", "Ever Grande City", "Fallarbor Town", "Fight Area", "Five Island", "Floaroma Town", "Floccesy Town", "Fortree City", "Four Island", "Frontier Access", "Fuchsia City", "Geosenge Town", "Goldenrod City", "Hearthome City", "Humilau City", "Icirrus City", "Jubilife City", "Kiloude City", "Lacunosa Town", "Lavaridge Town", "Lavender Town", "Laverre City", "Lentimas Town", "Littleroot Town", "Lilycove City", "Lumiose City", "Mahogany Town", "Mauville City", "Mistralton City", "Mossdeep City", "Nacrene City", "New Bark Town", "Nimbasa City", "Nuvema Town", "Oldale Town", "Olivine City", "One Island", "Opelucid City", "Oreburgh City", "Pacifidlog Town", "Pallet Town", "Pastoria City", "Petalburg City", "Pewter City", "Resort Area", "Rustboro City", "Safari Zone Gate", "Saffron City", "Sandgem Town", "Santalune City", "Striaton City", "Seven Island", "Shalour City", "Six Island", "Slateport City", "Snowbelle City", "Snowpoint City", "Solaceon Town", "Sootopolis City", "Sunyshore City", "Survival Area", "Three Island", "Twinleaf Town", "Two Island", "Undella Town", "Vaniville Town", "Veilstone City", "Verdanturf Town", "Vermilion City", "Violet City", "Virbank City", "Viridian City", "White Forest"] \ No newline at end of file diff --git a/test/test_faker_pokemon.rb b/test/test_faker_pokemon.rb new file mode 100644 index 0000000000..ee6e78edce --- /dev/null +++ b/test/test_faker_pokemon.rb @@ -0,0 +1,16 @@ +require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb') + +class TestFakerPokemon < Test::Unit::TestCase + def setup + @tester = Faker::Pokemon + end + + def test_name + assert @tester.name.match(/\w+/) + end + + def test_location + assert @tester.location.match(/\w+/) + end + +end