Sha256: 7b7db6ef9f16f29ff77d4daedfa948185440ec8b3dead0a612bb5184f9272e0c

Contents?: true

Size: 750 Bytes

Versions: 3

Compression:

Stored size: 750 Bytes

Contents

# encoding: utf-8

require 'helper'

# Test features related to Finnish addresses
class TestAddressFI < Test::Unit::TestCase
  ALPHA = /\A[\p{Alpha}]+/
  DIGIT = /\d{1}/

  def test_fi_city
    assert_match ALPHA, FFaker::AddressFI.city
  end

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

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

  def test_fi_full_address
    address = FFaker::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 FFaker::AddressFI.zip_code.frozen? == false
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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