Sha256: 5ff67f82e9bddf6e914057a2733f4b1ddd34e7d417c7c68e34c63e7ebeaba756

Contents?: true

Size: 902 Bytes

Versions: 1

Compression:

Stored size: 902 Bytes

Contents

# frozen_string_literal: true

require_relative 'helper'

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

  ALPHA = /\A\p{Alpha}+/.freeze
  DIGIT = /\d{1}/.freeze

  assert_methods_are_deterministic(
    FFakerTW::AddressFI,
    :city, :full_address, :random_country, :zip_code
  )

  def test_fi_city
    assert_match(ALPHA, FFakerTW::AddressFI.city)
  end

  def test_fi_zip_code
    assert_match(/\d{2}/, FFakerTW::AddressFI.zip_code)
  end

  def test_countries
    assert FFakerTW::AddressFI::COUNTRIES.include?(FFakerTW::AddressFI.random_country)
  end

  def test_fi_full_address
    address = FFakerTW::AddressFI.full_address
    assert_match(ALPHA, address)
    assert_match(DIGIT, address)
    assert_match(/SUOMI/, address)
    assert_match(/[, a-z]/, address)
  end

  def test_fi_zip_code_frozen
    assert FFakerTW::AddressFI.zip_code.frozen? == false
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ffakerTW-0.1.0 test/test_address_fi.rb