Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 60 lines (46 sloc) 1.375 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
# => author: wiseleyb
# => email: wiseleyb@gmail.com
require 'helper'

class TestAddressAU < Test::Unit::TestCase
  
  def test_au_state_abbr
    arr = Faker::AddressAU::STATE_ABBR.sort
    assert arr = Faker::AddressAU::CITY.keys.sort
    assert arr = Faker::AddressAU::ZIP_CODE.keys.sort
  end
  
  def test_au_state
    assert_match /[ a-z]/, Faker::AddressAU.state
  end

  def test_au_state_abbr
    assert_match /[A-Z]/, Faker::AddressAU.state_abbr
  end

  def test_au_city
    assert_match /[a-zA-Z]/, Faker::AddressAU.city
  end
  
  def test_zip_code
    assert_match /\d{4}/, Faker::AddressAU.zip_code
  end

  def test_postcode
    assert_match /\d{4}/, Faker::AddressAU.postcode
  end

  def test_full_address
    assert_match /[\, a-z]/, Faker::AddressAU.full_address
  end
  
  def test_zip_code_frozen
    assert Faker::AddressAU.zip_code.frozen? == false
  end

  def test_au_city_with_states
    Faker::AddressAU::STATE_ABBR.each do |st_abbr|
      assert_match /[a-zA-Z]/, Faker::AddressAU.city(st_abbr)
    end
  end

  def test_zip_code_with_states
    Faker::AddressAU::STATE_ABBR.each do |st_abbr|
      assert_match /\d{4}/, Faker::AddressAU.zip_code(st_abbr)
    end
  end

  def test_full_address_with_states
    Faker::AddressAU::STATE_ABBR.each do |st_abbr|
      assert_match /[\, a-z]/, Faker::AddressAU.full_address(st_abbr)
    end
  end

end
Something went wrong with that request. Please try again.