Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add Hobby to default * add # @faker.version per request
- Loading branch information
1 parent
3afbb93
commit cbe6017
Showing
5 changed files
with
219 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,6 @@ | ||
# Faker::Food | ||
|
||
# @faker.version next | ||
|
||
```ruby | ||
Faker::Hobby.activity #=> "Cooking" |
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,22 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class Hobby < Base | ||
flexible :hobby | ||
|
||
class << self | ||
## | ||
# Retrieves a typical hobby activity. | ||
# | ||
# @return [String] | ||
# | ||
# @example | ||
# Faker::Hobby.activity #=> "Cooking" | ||
# | ||
# @faker.version next | ||
def activity | ||
fetch('hobby.activity') | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
en: | ||
faker: | ||
hobby: | ||
activity: | ||
- 3D printing | ||
- amateur radio | ||
- scrapbook | ||
- Amateur radio | ||
- Acting | ||
- Baton twirling | ||
- Board games | ||
- Book restoration | ||
- Cabaret | ||
- Calligraphy | ||
- Candle making | ||
- Computer programming | ||
- Coffee roasting | ||
- Cooking | ||
- Coloring | ||
- Cosplaying | ||
- Couponing | ||
- Creative writing | ||
- Crocheting | ||
- Cryptography | ||
- Dance | ||
- Digital arts | ||
- Drama | ||
- Drawing | ||
- Do it yourself | ||
- Electronics | ||
- Embroidery | ||
- Fashion | ||
- Flower arranging | ||
- Foreign language learning | ||
- Gaming | ||
- tabletop games | ||
- role-playing games | ||
- Gambling | ||
- Genealogy | ||
- Glassblowing | ||
- Gunsmithing | ||
- Homebrewing | ||
- Ice skating | ||
- Jewelry making | ||
- Jigsaw puzzles | ||
- Juggling | ||
- Knapping | ||
- Knitting | ||
- Kabaddi | ||
- Knife making | ||
- Lacemaking | ||
- Lapidary | ||
- Leather crafting | ||
- Lego building | ||
- Lockpicking | ||
- Machining | ||
- Macrame | ||
- Metalworking | ||
- Magic | ||
- Model building | ||
- Listening to music | ||
- Origami | ||
- Painting | ||
- Playing musical instruments | ||
- Pet | ||
- Poi | ||
- Pottery | ||
- Puzzles | ||
- Quilting | ||
- Reading | ||
- Scrapbooking | ||
- Sculpting | ||
- Sewing | ||
- Singing | ||
- Sketching | ||
- Soapmaking | ||
- Sports | ||
- Stand-up comedy | ||
- Sudoku | ||
- Table tennis | ||
- Taxidermy | ||
- Video gaming | ||
- Watching movies | ||
- Web surfing | ||
- Whittling | ||
- Wood carving | ||
- Woodworking | ||
- Worldbuilding | ||
- Writing | ||
- Yoga | ||
- Yo-yoing | ||
- Air sports | ||
- Archery | ||
- Astronomy | ||
- Backpacking | ||
- BASE jumping | ||
- Baseball | ||
- Basketball | ||
- Beekeeping | ||
- Bird watching | ||
- Blacksmithing | ||
- Board sports | ||
- Bodybuilding | ||
- Brazilian jiu-jitsu | ||
- Community | ||
- Cycling | ||
- Dowsing | ||
- Driving | ||
- Fishing | ||
- Flag Football | ||
- Flying | ||
- Flying disc | ||
- Foraging | ||
- Gardening | ||
- Geocaching | ||
- Ghost hunting | ||
- Graffiti | ||
- Handball | ||
- Hiking | ||
- Hooping | ||
- Horseback riding | ||
- Hunting | ||
- Inline skating | ||
- Jogging | ||
- Kayaking | ||
- Kite flying | ||
- Kitesurfing | ||
- LARPing | ||
- Letterboxing | ||
- Metal detecting | ||
- Motor sports | ||
- Mountain biking | ||
- Mountaineering | ||
- Mushroom hunting | ||
- Mycology | ||
- Netball | ||
- Nordic skating | ||
- Orienteering | ||
- Paintball | ||
- Parkour | ||
- Photography | ||
- Polo | ||
- Rafting | ||
- Rappelling | ||
- Rock climbing | ||
- Roller skating | ||
- Rugby | ||
- Running | ||
- Sailing | ||
- Sand art | ||
- Scouting | ||
- Scuba diving | ||
- Sculling | ||
- Rowing | ||
- Shooting | ||
- Shopping | ||
- Skateboarding | ||
- Skiing | ||
- Skimboarding | ||
- Skydiving | ||
- Slacklining | ||
- Snowboarding | ||
- Stone skipping | ||
- Surfing | ||
- Swimming | ||
- Taekwondo | ||
- Tai chi | ||
- Urban exploration | ||
- Vacation | ||
- Vehicle restoration | ||
- Water sports |
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,19 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../../test_helper' | ||
|
||
class TestFakerHobby < Test::Unit::TestCase | ||
def setup | ||
@tester = Faker::Hobby | ||
end | ||
|
||
def test_flexible_key | ||
flexible_key = @tester.instance_variable_get('@flexible_key') | ||
|
||
assert flexible_key == :hobby | ||
end | ||
|
||
def test_activity | ||
assert @tester.activity.match(/\w+/) | ||
end | ||
end |