Sha256: 05c4cd4af177f22399bb405ea29911e6b941288e82ed77c749da59371153456b

Contents?: true

Size: 1.44 KB

Versions: 3

Compression:

Stored size: 1.44 KB

Contents

# encoding: utf-8

require 'helper'

# Author: wiseleyb<wiseleyb@gmail.com>
class TestAddressAU < Test::Unit::TestCase

  def test_au_state_abbr_insertion
    arr = FFaker::AddressAU::STATE_ABBR.sort
    assert arr = FFaker::AddressAU::SUBURB.keys.sort
    assert arr = FFaker::AddressAU::POSTCODE.keys.sort
  end

  def test_au_state
    assert_match /[ a-z]/, FFaker::AddressAU.state
  end

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

  def test_au_suburb
    assert_match /[a-zA-Z]/, FFaker::AddressAU.suburb
  end

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

  def test_full_address
    assert_match /[\, a-z]/, FFaker::AddressAU.full_address
  end

  def test_au_suburb_with_states
    FFaker::AddressAU::STATE_ABBR.each do |st_abbr|
      assert_match /[a-zA-Z]/, FFaker::AddressAU.suburb(st_abbr)
    end
  end

  def test_au_suburb_with_state_and_postcodes
    FFaker::AddressAU::STATE_ABBR.each do |st_abbr|
      p_code = FFaker::AddressAU.postcode(st_abbr)
      assert_match /[a-zA-Z]/, FFaker::AddressAU.suburb(st_abbr, p_code)
    end
  end

  def test_postcode_with_states
    FFaker::AddressAU::STATE_ABBR.each do |st_abbr|
      assert_match /\d{4}/, FFaker::AddressAU.postcode(st_abbr)
    end
  end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ffaker-2.2.0 test/test_address_au.rb
ffaker-2.1.0 test/test_address_au.rb
ffaker-2.0.0 test/test_address_au.rb