Skip to content

Commit

Permalink
WIP add dragon ball characters to faker (#839)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cdunagan05 authored and stympy committed Mar 18, 2017
1 parent 665d55b commit 2b189c8
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Contents
- [Faker::Crypto](doc/crypto.md)
- [Faker::Date](doc/date.md)
- [Faker::Demographic](doc/demographic.md)
- [Faker::DragonBall](doc/dragon_ball.md)
- [Faker::Educator](doc/educator.md)
- [Faker::File](doc/file.md)
- [Faker::Fillmurray](doc/fillmurray.md)
Expand Down
5 changes: 5 additions & 0 deletions doc/dragon_ball.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Faker::DragonBall

```ruby
Faker::DragonBall.character #=> "Goku"
```
1 change: 1 addition & 0 deletions lib/faker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ def rand(max = nil)
require 'faker/friends'
require 'faker/rick_and_morty'
require 'faker/matz'
require 'faker/dragon_ball'
require 'faker/rupaul'

require 'extensions/array'
Expand Down
9 changes: 9 additions & 0 deletions lib/faker/dragon_ball.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module Faker
class DragonBall < Base
class << self
def character
fetch('dragon_ball.characters')
end
end
end
end
2 changes: 2 additions & 0 deletions lib/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,8 @@ en:
"Everyone has an individual background. Someone may come from Python, someone else may come from Perl, and they may be surprised by different aspects of the language. Then they come up to me and say, 'I was surprised by this feature of the language, so therefore Ruby violates the principle of least surprise.' Wait. Wait. The principle of least surprise is not for you only.",
"Sometimes people jot down pseudo-code on paper. If that pseudo-code runs directly on their computers, its best, isn't it? Ruby tries to be like that, like pseudo-code that runs. Python people say that too."
]
dragon_ball:
characters: ["Goku", "Bulma", "Kami", "Yamcha", "Krillin", "Tien", "Piccolo", "Gohan", "Vegeta", "Kid Trunks", "Goten", "Future Trunks", "Pan", "Android 18", "Android 16", "Android 17", "Android 19", "Android 20", "Beerus", "Chaozu", "Chi-Chi", "Launch", "Mr. Satan", "Oolong", "Puar", "Videl", "Whis", "Yajirobe", "Demon King Piccolo", "Freeza", "Cell", "Majin Buu", "Goku Black", "Zamasu", "Baba", "Bra", "Bardock", "Champa", "Dende", "Dr. Gero", "Captain Ginyu", "Grandpa Gohan", "Jaco", "King Kai", "Supreme Kai", "Elder Kai", "Mr. Popo", "Nappa", "Uub", "Pilaf", "Raditz", "Shenron", "Vados", "Zarbon", "Broly", "Cooler", "King Cold", "Garlic Jr", "King Vegeta", "Nail", "Guru", "Hit", "Super Saiyan Goku", "Super Saiyan 2 Goku", "Super Saiyan 3 Goku", "Super Saiyan Vegeta", "Super Saiyan 2 Vegeta", "Majin Vegeta", "Super Saiyan Gohan", "Super Saiyan 2 Gohan", "Super Saiyan Goten", "Super Saiyan Trunks", "Vegito", "Gogeta", "Super Saiyan Blue Goku", "Super Saiyan Blue Vegeta", "Mystic Gohan"]
rupaul:
quotes: [
"Glamazon!",
Expand Down
11 changes: 11 additions & 0 deletions test/test_faker_dragon_ball.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb')

class TestFakerDragonBall < Test::Unit::TestCase
def setup
@tester = Faker::DragonBall
end

def test_character
assert @tester.character.match(/\w+/)
end
end

0 comments on commit 2b189c8

Please sign in to comment.