Skip to content

Commit

Permalink
Add Pokemon names and locations
Browse files Browse the repository at this point in the history
  • Loading branch information
shinwang1 authored and stympy committed Jul 19, 2016
1 parent 05305a7 commit a2c17dc
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Contents
- [Faker::Music](#fakermusic)
- [Faker::Vehicle](#fakervehicle)
- [Faker::GameOfThrones](#fakergameofthrones)
- [Faker::Pokemon](#pokemon)
- [Customization](#customization)
- [Contributing](#contributing)
- [Contact](#contact)
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/faker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
13 changes: 13 additions & 0 deletions lib/faker/pokemon.rb
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions lib/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
16 changes: 16 additions & 0 deletions test/test_faker_pokemon.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a2c17dc

Please # to comment.