Skip to content

Commit

Permalink
Add Faker::StarTrek (faker-ruby#884)
Browse files Browse the repository at this point in the history
  • Loading branch information
akintner authored and stympy committed Apr 18, 2017
1 parent a949848 commit bb3f8fa
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Contents
- [Faker::RuPaul](doc/rupaul.md)
- [Faker::SlackEmoji](doc/slack_emoji.md)
- [Faker::Space](doc/space.md)
- [Faker::StarTrek](doc/star_trek.md)
- [Faker::StarWars](doc/star_wars.md)
- [Faker::Superhero](doc/superhero.md)
- [Faker::Team](doc/team.md)
Expand Down
12 changes: 12 additions & 0 deletions doc/star_trek.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Faker::StarTrek

```ruby
Faker::StarTrek.character #=> "Spock"

Faker::StarTrek.location #=> "Cardassia"

Faker::StarTrek.specie #=> "Ferengi"

Faker::StarTrek.villain #=> "Khan Noonien Singh"

```
21 changes: 21 additions & 0 deletions lib/faker/star_trek.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module Faker
class StarTrek < Base
class << self
def character
fetch('star_trek.character')
end

def location
fetch('star_trek.location')
end

def specie
fetch('star_trek.specie')
end

def villain
fetch('star_trek.villain')
end
end
end
end
5 changes: 5 additions & 0 deletions lib/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -691,3 +691,8 @@ en:
"Revenge fantasies never work out the way you want.",
"Whether a gesture’s charming or alarming, depends on how it’s received."
]
star_trek:
character: ["James Tiberius Kirk", "Jean-Luc Picard", "Benjamin Sisko", "Kira Nerys", "Odo", "Jadzia Dax", "Julian Bashir", "Miles O'Brien", "Quark", "Jake Sisko", "Kathryn Janeway", "Chakotay", "Tuvok", "Tom Paris", "B'Elanna Torres", "Harry Kim", "Seven of Nine", "The Doctor", "Neelix", "Kes", "Jonathan Archer", "T'Pol", "Charles Tucker III", "Malcolm Reed", "Travis Mayweather", "Hoshi Sato", "Phlox", "Data", "William T. Riker", "Geordi La Forge", "Worf", "Beverly Crusher", "Deanna Troi", "Natasha Yar", "Wesley Crusher", "Spock", "Leonard McCoy", "Montgomery Scott", "Hikaru Sulu", "Pavel Chekov", "Nyota Uhuru"]
location: ["Qo'noS", "Romulus", "Bajor", "Vulcan", "Neutral Zone", "Alpha Quadrant", "Beta Quadrant", "Delta Quadrant", "Gamma Quadrant", "Tau Ceti Prime", "Wolf 359", "Thalos VII", "Cardassia", "Trillius Prime", "Badlands", "Betazed", "Risa", "Deep Space Nine", "Ferenginar", "The Briar Patch", "Khitomer"]
specie: ["Breen", "El-Aurian", "Jem'Hadar", "Kazon", "Ocampa", "Q", "Ferengi", "Klingon", "Talaxian", "Vidiian", "Cardassian", "Vulcan", "Borg", "Romulan", "Vorta", "Andorian", "Bajoran", "Betazoid"]
villain: ["Q", "Gorn", "Khan Noonien Singh", "Ru'afo", "Maltz", "Kruge", "Ayel", "Admiral Marcus", "Martia", "Lt. Valeris", "V'ger", "God of Sha Ka Ree", "Admiral Dougherty", "Nero", "Krall", "Tolian Soran", "Shinzon", "General Chang", "Lursa", "B'Etor", "Borg Queen"]
23 changes: 23 additions & 0 deletions test/test_faker_star_trek.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require File.expand_path(File.dirname(__FILE__) + '/test_helper')

class TestFakerStarTrek < Test::Unit::TestCase
def setup
@tester = Faker::StarTrek
end

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

def test_locations
assert @tester.location.match(/\w+/)
end

def test_species
assert @tester.specie.match(/\w+/)
end

def test_villains
assert @tester.villain.match(/\w+/)
end
end

0 comments on commit bb3f8fa

Please sign in to comment.