-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Faker::HitchhikersGuideToTheGalaxy (#914)
- Loading branch information
1 parent
8605ac6
commit f69e09c
Showing
5 changed files
with
129 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,17 @@ | ||
# Faker::HitchhikersGuideToTheGalaxy | ||
|
||
```ruby | ||
Faker::HitchhikersGuideToTheGalaxy.character #=> "Marvin" | ||
|
||
Faker::HitchhikersGuideToTheGalaxy.location #=> "Arthur Dent's house" | ||
|
||
Faker::HitchhikersGuideToTheGalaxy.marvin_quote #=> "Life? Don't talk to me about life." | ||
|
||
Faker::HitchhikersGuideToTheGalaxy.planet #=> "Magrathea" | ||
|
||
Faker::HitchhikersGuideToTheGalaxy.quote #=> "In the beginning, the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." | ||
|
||
Faker::HitchhikersGuideToTheGalaxy.specie #=> "Perfectly Normal Beast" | ||
|
||
Faker::HitchhikersGuideToTheGalaxy.starship #=> "Vogon Constructor Fleet" | ||
``` |
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,33 @@ | ||
module Faker | ||
class HitchhikersGuideToTheGalaxy < Base | ||
class << self | ||
def character | ||
fetch('hitchhikers_guide_to_the_galaxy.characters') | ||
end | ||
|
||
def location | ||
fetch('hitchhikers_guide_to_the_galaxy.locations') | ||
end | ||
|
||
def marvin_quote | ||
fetch('hitchhikers_guide_to_the_galaxy.marvin_quote') | ||
end | ||
|
||
def planet | ||
fetch('hitchhikers_guide_to_the_galaxy.planets') | ||
end | ||
|
||
def quote | ||
fetch('hitchhikers_guide_to_the_galaxy.quotes') | ||
end | ||
|
||
def specie | ||
fetch('hitchhikers_guide_to_the_galaxy.species') | ||
end | ||
|
||
def starship | ||
fetch('hitchhikers_guide_to_the_galaxy.starships') | ||
end | ||
end | ||
end | ||
end |
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,35 @@ | ||
require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb') | ||
|
||
class TestFakerHitchhikersGuideToTheGalaxy < Test::Unit::TestCase | ||
def setup | ||
@tester = Faker::HitchhikersGuideToTheGalaxy | ||
end | ||
|
||
def test_character | ||
assert @tester.character.match(/\w+/) | ||
end | ||
|
||
def test_location | ||
assert @tester.location.match(/\w+/) | ||
end | ||
|
||
def test_marvin_quote | ||
assert @tester.marvin_quote.match(/\w+/) | ||
end | ||
|
||
def test_planet | ||
assert @tester.planet.match(/\w+/) | ||
end | ||
|
||
def test_quote | ||
assert @tester.quote.match(/\w+/) | ||
end | ||
|
||
def test_specie | ||
assert @tester.specie.match(/\w+/) | ||
end | ||
|
||
def test_starship | ||
assert @tester.starship.match(/\w+/) | ||
end | ||
end |