-
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 initial test * Add Australia class and first method locations * Add 50 australian locations * Add Australian animals * Rename folder * Add Australian States * Fix typos * Fix more typos * Fix spacing * Add faker version documentation
- Loading branch information
Showing
3 changed files
with
176 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class Australia < Base | ||
class << self | ||
## | ||
# Produces a location in Australia | ||
# | ||
# @return [String] | ||
# | ||
# @example | ||
# Faker::Australia.location | ||
# #=> "Sydney" | ||
# | ||
# @faker.version next | ||
def location | ||
fetch('australia.locations') | ||
end | ||
|
||
# Produces an Australian animal | ||
# | ||
# @return [String] | ||
# | ||
# @example | ||
# Faker::Australia.animal | ||
# #=> "Dingo" | ||
# | ||
# @faker.version next | ||
def animal | ||
fetch('australia.animals') | ||
end | ||
|
||
# Produces an Australian State or Territory | ||
# | ||
# @return [String] | ||
# | ||
# @example | ||
# Faker::Australia.state | ||
# #=> "New South Wales" | ||
# | ||
# @faker.version next | ||
def state | ||
fetch('australia.states') | ||
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,108 @@ | ||
en: | ||
faker: | ||
australia: | ||
locations: | ||
- Brisbane | ||
- Sydney | ||
- Melbourne | ||
- Brisbane | ||
- Perth | ||
- Adelaide | ||
- Gold Coast | ||
- Newcastle | ||
- Canberra | ||
- Central Coast | ||
- Sunshine Coast | ||
- Wollongong | ||
- Geelong | ||
- Hobart | ||
- Townsville | ||
- Cairns | ||
- Toowoomba | ||
- Darwin | ||
- Ballarat | ||
- Bendigo | ||
- Albury | ||
- Launceston | ||
- Mackay | ||
- Rockhampton | ||
- Bunbury | ||
- Coffs Harbour | ||
- Bundaberg | ||
- Melton | ||
- Wagga Wagga | ||
- Hervey Bay | ||
- Mildura – Wentworth | ||
- Shepparton – Mooroopna | ||
- Port Macquarie | ||
- Gladstone – Tannum Sands | ||
- Tamworth | ||
- Traralgon – Morwell | ||
- Orange | ||
- Bowral – Mittagong | ||
- Busselton | ||
- Geraldton | ||
- Dubbo | ||
- Nowra – Bomaderry | ||
- Warragul – Drouin | ||
- Bathurst | ||
- Warrnambool | ||
- Albany | ||
- Kalgoorlie | ||
- Devonport | ||
- Mount Gambier | ||
- Lismore | ||
- Nelson Bay | ||
animals: | ||
- Koala | ||
- Humpback Whale | ||
- Australian Fur Seal | ||
- Wallaby | ||
- Platypus | ||
- Kangaroo | ||
- Wombat | ||
- Sugar Glider | ||
- Flying Fox | ||
- Tasmanian Devil | ||
- Quokka | ||
- Dugong | ||
- Luaner | ||
- Echidna | ||
- Magpie | ||
- Cockatoo | ||
- Tawny Frogmouth | ||
- Galah | ||
- Lorikeet | ||
- Pelican | ||
- Cassowary | ||
- Kookaburra | ||
- Emu | ||
- Lyrebird | ||
- Barramundi | ||
- Grouper | ||
- Murray Cod | ||
- Green Tree Frog | ||
- Cane Toad | ||
- Redback Spider | ||
- Funnel Web Spider | ||
- Blue Ringed OCtopus | ||
- Fresh Water Crocodile | ||
- Skink | ||
- Thorny Devil | ||
- King Brown Snake | ||
- Carpet Python | ||
- Tiger Snake | ||
- Red Bellied Black Snake | ||
- Blue Tongue Lizard | ||
- Frilled Neck Lizard | ||
- Saltwater Crocodile | ||
- Eastern Brown Snake | ||
states: | ||
- New South wales | ||
- Queensland | ||
- Western Australia | ||
- Northern Territory | ||
- South Australia | ||
- Australian Capital Territory | ||
- Visctoria | ||
- Tasmania |
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,21 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../../test_helper' | ||
|
||
class TestFakerAustralia < Test::Unit::TestCase | ||
def setup | ||
@tester = Faker::Australia | ||
end | ||
|
||
def test_location | ||
assert @tester.location.match(/\w+/) | ||
end | ||
|
||
def test_animal | ||
assert @tester.animal.match(/\w+/) | ||
end | ||
|
||
def test_state | ||
assert @tester.state.match(/\w+/) | ||
end | ||
end |