Sha256: c9fb94c3fa90ff42131657d17151e54c987045a923d064e8bf8ef939843e7717

Contents?: true

Size: 703 Bytes

Versions: 9

Compression:

Stored size: 703 Bytes

Contents

# frozen_string_literal: true

require 'test_helper'

module Europe
  module Postal
    # FormatTest
    class FormatTest < Minitest::Test
      def test_several_postal_codes
        # Netherlands
        assert Europe::Postal.validate('NL', '1000 AP')

        # German
        assert Europe::Postal.validate('DE', '02782')

        # UK
        assert Europe::Postal.validate('GB', 'SW1W 0NY')
      end

      def test_fail_several_postal_codes
        # Netherlands
        refute Europe::Postal.validate('NL', '1000x AP')

        # German
        refute Europe::Postal.validate('DE', 'BW02782')

        # UK
        refute Europe::Postal.validate('GB', 'XSW1Wxx 0NY')
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
europe-0.0.22 test/europe/postal/format_test.rb
europe-0.0.21 test/europe/postal/format_test.rb
europe-0.0.20 test/europe/postal/format_test.rb
europe-0.0.19 test/europe/postal/format_test.rb
europe-0.0.18 test/europe/postal/format_test.rb
europe-0.0.17 test/europe/postal/format_test.rb
europe-0.0.16 test/europe/postal/format_test.rb
europe-0.0.15 test/europe/postal/format_test.rb
europe-0.0.14 test/europe/postal/format_test.rb