Sha256: a51d6aa89656bf2508fa9bc0d46ddbea6622923d048ae49b778f573c8ebe4ceb

Contents?: true

Size: 941 Bytes

Versions: 2

Compression:

Stored size: 941 Bytes

Contents

# frozen_string_literal: true

require_relative 'helper'

class TestAddressBR < Test::Unit::TestCase
  include DeterministicHelper

  assert_methods_are_deterministic(
    FFaker::AddressBR,
    :zip_code, :state, :state_abbr, :city, :street_prefix, :street, :full_address
  )

  def test_zip_code
    assert_match(/\d{5}-\d{3}/, FFaker::AddressBR.zip_code)
  end

  def test_state
    assert FFaker::AddressBR::STATE.include?(FFaker::AddressBR.state)
  end

  def test_state_abbr
    assert FFaker::AddressBR::STATE_ABBR.include?(FFaker::AddressBR.state_abbr)
  end

  def test_city
    assert FFaker::AddressBR::CITY.include?(FFaker::AddressBR.city)
  end

  def test_street_prefix
    assert FFaker::AddressBR::STREET_PREFIX.include?(FFaker::AddressBR.street_prefix)
  end

  def test_street
    prefixes = FFaker::AddressBR::STREET_PREFIX
    assert_match(/(#{prefixes.join('|')})( \p{Alpha}+){1,2}/, FFaker::AddressBR.street)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ffaker-2.20.0 test/test_address_br.rb
ffaker-2.19.0 test/test_address_br.rb