Sha256: 0ae93c08b533d9fb91829c9a9e38768444252fad1ce455ef3f7acecc1be22d35

Contents?: true

Size: 932 Bytes

Versions: 6

Compression:

Stored size: 932 Bytes

Contents

# encoding: utf-8

require 'helper'

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

  assert_methods_are_deterministic(
    FFaker::AddressGR,
    :city, :region, :zip_code, :street_name, :street_nbr, :street_address
  )

  def setup
    @address_gr = FFaker::AddressGR
    @street_prefix = FFaker::AddressGR::STREET_PREFIX.join('|')
  end

  def test_city
    assert_match(/\p{Greek}/, @address_gr.city)
  end

  def test_region
    assert_match(/\p{Greek}/, @address_gr.region)
  end

  def test_zip_code
    assert_match(/\A\d{5}\z/, @address_gr.zip_code)
  end

  def test_street_name
    assert_match(/\p{Greek}/, @address_gr.street_name)
  end

  def test_street_nbr
    assert_match(/\A\d{1,3}\z/, @address_gr.street_nbr)
  end

  def test_street_address
    address = FFaker::AddressGR.street_address
    assert_match(/#{@street_prefix}/, address)
    assert_match(/\p{Greek}/, address)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ffaker-2.11.0 test/test_address_gr.rb
ffaker-2.10.0 test/test_address_gr.rb
ffaker-2.9.0 test/test_address_gr.rb
ffaker-2.8.1 test/test_address_gr.rb
ffaker-2.8.0 test/test_address_gr.rb
ffaker-2.7.0 test/test_address_gr.rb