Sha256: 007866b4d17d9c2fdcdbcb652ed4c2cca00062433428a0b6d625e3c249577501

Contents?: true

Size: 884 Bytes

Versions: 5

Compression:

Stored size: 884 Bytes

Contents

# frozen_string_literal: true

require 'helper'

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

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

  assert_methods_are_deterministic(
    FFaker::AddressSE,
    :city, :random_country, :full_address, :zip_code
  )

  def test_se_city
    assert_match(ALPHA, FFaker::AddressSE.city)
  end

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

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

  def test_se_full_address
    address = FFaker::AddressSE.full_address
    assert_match(ALPHA, address)
    assert_match(DIGIT, address)
    assert_match(/SVERIGE/, address)
    assert_match(/[\, a-z]/, address)
  end

  def test_se_zip_code_frozen
    assert FFaker::AddressSE.zip_code.frozen? == false
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ffaker-2.16.0 test/test_address_se.rb
ffaker-2.15.0 test/test_address_se.rb
ffaker-2.14.0 test/test_address_se.rb
ffaker-2.13.0 test/test_address_se.rb
ffaker-2.12.0 test/test_address_se.rb