Sha256: d7a3acdf64329440d019e97e1f7793c3c4c7179e4d9c4f219cde708999c59cce

Contents?: true

Size: 1.41 KB

Versions: 4

Compression:

Stored size: 1.41 KB

Contents

# encoding: utf-8

require 'helper'

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

  def test_au_state_abbr
    arr = Faker::AddressAU::STATE_ABBR.sort
    assert arr = Faker::AddressAU::SUBURB.keys.sort
    assert arr = Faker::AddressAU::POSTCODE.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_suburb
    assert_match /[a-zA-Z]/, Faker::AddressAU.suburb
  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_au_suburb_with_states
    Faker::AddressAU::STATE_ABBR.each do |st_abbr|
      assert_match /[a-zA-Z]/, Faker::AddressAU.suburb(st_abbr)
    end
  end

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

  def test_postcode_with_states
    Faker::AddressAU::STATE_ABBR.each do |st_abbr|
      assert_match /\d{4}/, Faker::AddressAU.postcode(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

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
ffakerer-1.0.2 test/test_address_au.rb
ffakerer-1.0.1 test/test_address_au.rb
ffaker-1.22.1 test/test_address_au.rb
ffaker-1.22.0 test/test_address_au.rb