phone 1.2.3 → 1.3.0.beta0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.document +3 -0
- data/.gitignore +5 -0
- data/.ruby-version +1 -0
- data/.travis.yml +14 -0
- data/.yardopts +1 -0
- data/ChangeLog.md +50 -0
- data/Gemfile +11 -0
- data/LICENSE.txt +22 -0
- data/README.md +183 -0
- data/Rakefile +38 -0
- data/data/{phone_countries.yml → phone/countries.yml} +16 -14
- data/lib/phone.rb +75 -53
- data/lib/phone/country.rb +45 -0
- data/lib/{errors.rb → phone/errors.rb} +0 -0
- data/lib/phone/version.rb +4 -0
- data/phone.gemspec +25 -0
- data/test/countries/au_test.rb +11 -11
- data/test/countries/ba_test.rb +4 -4
- data/test/countries/be_test.rb +12 -11
- data/test/countries/de_test.rb +7 -7
- data/test/countries/es_test.rb +33 -0
- data/test/countries/fr_test.rb +5 -5
- data/test/countries/gb_test.rb +42 -41
- data/test/countries/hr_test.rb +14 -14
- data/test/countries/hu_test.rb +5 -5
- data/test/countries/ie_test.rb +20 -0
- data/test/countries/nl_test.rb +43 -43
- data/test/countries/nz_test.rb +8 -0
- data/test/countries/pt_test.rb +18 -18
- data/test/countries/rs_test.rb +7 -7
- data/test/countries/se_test.rb +44 -43
- data/test/countries/si_test.rb +7 -7
- data/test/countries/ua_test.rb +4 -4
- data/test/countries/us_test.rb +6 -6
- data/test/countries/uy_test.rb +22 -0
- data/test/countries/za_test.rb +4 -4
- data/test/extension_test.rb +3 -3
- data/test/helper.rb +41 -0
- data/test/phone_test.rb +99 -53
- data/test_usa_phones_with_extensions.csv +99 -0
- metadata +112 -30
- data/LICENSE +0 -19
- data/Readme.rdoc +0 -126
- data/lib/country.rb +0 -36
- data/lib/support.rb +0 -78
- data/test/test_helper.rb +0 -15
data/test/countries/de_test.rb
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
require
|
1
|
+
require "helper"
|
2
2
|
|
3
3
|
## Germany
|
4
|
-
class DETest < Test
|
4
|
+
class DETest < Minitest::Test
|
5
5
|
|
6
6
|
def test_local
|
7
7
|
parse_test('+49 714 1605832', '49', '714', '1605832')
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
def test_mobile
|
11
11
|
parse_test('+49 162 3499558', '49', '162', '3499558')
|
12
|
-
end
|
13
|
-
|
12
|
+
end
|
13
|
+
|
14
14
|
# TODO: germany has 2-5 length area codes, that's why this test doesn't go through
|
15
15
|
#def test_country_side
|
16
16
|
# parse_test('+49 (0)6120 59511-23', '49', '6120', '5951123')
|
17
|
-
#end
|
18
|
-
|
17
|
+
#end
|
18
|
+
|
19
19
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require "helper"
|
2
|
+
|
3
|
+
## Spain
|
4
|
+
# http://en.wikipedia.org/wiki/Telephone_numbers_in_Spain
|
5
|
+
# http://gospain.about.com/od/practicaltraveltips/f/area_codes.htm
|
6
|
+
|
7
|
+
# A problem is that landline area codes can be 2 (92) as well as 3 digits (923)
|
8
|
+
# right now the area_code_regexp is only finding 3 digit area_codes
|
9
|
+
|
10
|
+
class ESTest < Minitest::Test
|
11
|
+
|
12
|
+
def test_validates
|
13
|
+
Phoner::Phone.default_country_code = nil
|
14
|
+
assert_equal Phoner::Phone.valid?("+34-695-097-612"), true
|
15
|
+
assert_equal Phoner::Phone.valid?("0034 91-3597426"), true
|
16
|
+
assert_equal Phoner::Phone.valid?("+0034 91-3597426"), true
|
17
|
+
assert_equal Phoner::Phone.valid?("+34 92-6563629"), true
|
18
|
+
assert_equal Phoner::Phone.valid?("(+34) 606 275 213"), true
|
19
|
+
assert_equal Phoner::Phone.valid?("+034 937 299 016"), true
|
20
|
+
assert_equal Phoner::Phone.valid?("+34 93 487 32 93"), true
|
21
|
+
|
22
|
+
Phoner::Phone.default_country_code = '34'
|
23
|
+
assert_equal Phoner::Phone.valid?(" 607 65 05 01 "), true
|
24
|
+
assert_equal Phoner::Phone.valid?(" 971 15 66 33"), true
|
25
|
+
assert_equal Phoner::Phone.valid?(" 93-4559934"), true
|
26
|
+
assert_equal Phoner::Phone.valid?("628 274 908"), true
|
27
|
+
assert_equal Phoner::Phone.valid?("744 486 62 78"), true
|
28
|
+
assert_equal Phoner::Phone.valid?("916754559"), true
|
29
|
+
assert_equal Phoner::Phone.valid?("93.4327119"), true
|
30
|
+
assert_equal Phoner::Phone.valid?("986300257"), true
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
data/test/countries/fr_test.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
require
|
1
|
+
require "helper"
|
2
2
|
|
3
3
|
## France
|
4
|
-
class FRTest < Test
|
4
|
+
class FRTest < Minitest::Test
|
5
5
|
|
6
6
|
def test_local
|
7
7
|
parse_test('+33 4 75 06 07 07', '33', '4', '75060707')
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
def test_mobile
|
11
11
|
parse_test('+33 6 11 22 33 44', '33', '6', '11223344')
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def test_mobile_07
|
15
15
|
parse_test('+33 7 11 22 33 44', '33', '7', '11223344')
|
16
16
|
end
|
@@ -18,5 +18,5 @@ class FRTest < Test::Unit::TestCase
|
|
18
18
|
def test_voip
|
19
19
|
parse_test('+33 9 11 22 33 44', '33', '9', '11223344')
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
end
|
data/test/countries/gb_test.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require "helper"
|
2
3
|
|
3
4
|
# http://stakeholders.ofcom.org.uk/telecoms/numbering/guidance-tele-no/numbers-for-drama
|
4
5
|
#
|
5
|
-
# Geographic Area Geographic Area Code Telephone Number Range
|
6
|
+
# Geographic Area Geographic Area Code Telephone Number Range
|
6
7
|
# (1000 numbers in each range)
|
7
8
|
# Leeds 0113 496 0000 to 496 0999
|
8
9
|
# Sheffield 0114 496 0000 to 496 0999
|
@@ -16,34 +17,34 @@ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
|
|
16
17
|
# Liverpool 0151 496 0000 to 496 0999
|
17
18
|
# Manchester 0161 496 0000 to 496 0999
|
18
19
|
# London 020 7946 0000 to 7946 0999
|
19
|
-
# Tyneside/Durham
|
20
|
+
# Tyneside/Durham
|
20
21
|
#/Sunderland 0191 498 0000 to 498 0999
|
21
22
|
# Northern Ireland 028 9018 0000 to 9018 0999
|
22
23
|
# Cardiff 029 2018 0000 to 2018 0999
|
23
24
|
# No area 01632 960000 to 960999
|
24
|
-
#
|
25
|
+
#
|
25
26
|
# Other Telephone Numbers
|
26
|
-
#
|
27
|
-
# Telephone Number Type Telephone Number Range
|
27
|
+
#
|
28
|
+
# Telephone Number Type Telephone Number Range
|
28
29
|
# (1000 numbers in each range)
|
29
30
|
# Mobile 07700 900000 to 900999
|
30
31
|
# Freephone 08081 570000 to 570999
|
31
32
|
# Premium Rate Services 0909 8790000 to 8790999
|
32
33
|
# UK Wide 03069 990000 to 990999
|
33
34
|
|
34
|
-
class GBTest < Test
|
35
|
-
|
35
|
+
class GBTest < Minitest::Test
|
36
|
+
|
36
37
|
## SHORT CODES
|
37
38
|
# London 020 7946 0000 to 7946 0999
|
38
39
|
def test_london
|
39
|
-
parse_test('+44 20 7946 0123', '44', '20', '79460123')
|
40
|
+
parse_test('+44 20 7946 0123', '44', '20', '79460123')
|
40
41
|
end
|
41
|
-
|
42
|
+
|
42
43
|
# Northern Ireland 028 9018 0000 to 9018 0999
|
43
44
|
def test_northern_ireland
|
44
45
|
parse_test('+44 28 9018 0123', '44', '28', '90180123')
|
45
46
|
end
|
46
|
-
|
47
|
+
|
47
48
|
# Cardiff 029 2018 0000 to 2018 0999
|
48
49
|
def test_cardiff
|
49
50
|
parse_test('+44 29 2018 0123', '44', '29', '20180123')
|
@@ -58,139 +59,139 @@ class GBTest < Test::Unit::TestCase
|
|
58
59
|
def test_sheffield
|
59
60
|
parse_test('+44 114 496 0123', '44', '114', '4960123')
|
60
61
|
end
|
61
|
-
|
62
|
+
|
62
63
|
# Nottingham 0115 496 0000 to 496 0999
|
63
64
|
def test_nottingham
|
64
65
|
parse_test('+44 115 496 0123', '44', '115', '4960123')
|
65
66
|
end
|
66
|
-
|
67
|
+
|
67
68
|
# Leicester 0116 496 0000 to 496 0999
|
68
69
|
def test_leicester
|
69
70
|
parse_test('+44 116 496 0123', '44', '116', '4960123')
|
70
71
|
end
|
71
|
-
|
72
|
+
|
72
73
|
# Bristol 0117 496 0000 to 496 0999
|
73
74
|
def test_bristol
|
74
75
|
parse_test('+44 117 496 0123', '44', '117', '4960123')
|
75
76
|
end
|
76
|
-
|
77
|
+
|
77
78
|
# Reading 0118 496 0000 to 496 0999
|
78
79
|
def test_reading
|
79
80
|
parse_test('+44 118 496 0123', '44', '118', '4960123')
|
80
81
|
end
|
81
|
-
|
82
|
+
|
82
83
|
# Birmingham 0121 496 0000 to 496 0999
|
83
84
|
def test_birmingham
|
84
85
|
parse_test('+44 121 496 0123', '44', '121', '4960123')
|
85
86
|
end
|
86
|
-
|
87
|
+
|
87
88
|
# Edinburgh 0131 496 0000 to 496 0999
|
88
89
|
def test_edinburgh
|
89
90
|
parse_test('+44 131 496 0123', '44', '131', '4960123')
|
90
91
|
end
|
91
|
-
|
92
|
+
|
92
93
|
# Glasgow 0141 496 0000 to 496 0999
|
93
94
|
def test_glasgow
|
94
95
|
parse_test('+44 141 496 0123', '44', '141', '4960123')
|
95
96
|
end
|
96
|
-
|
97
|
+
|
97
98
|
# Liverpool 0151 496 0000 to 496 0999
|
98
99
|
def test_liverpool
|
99
100
|
parse_test('+44 151 496 0123', '44', '151', '4960123')
|
100
101
|
end
|
101
|
-
|
102
|
+
|
102
103
|
# Manchester 0161 496 0000 to 496 0999
|
103
104
|
def test_manchester
|
104
105
|
parse_test('+44 161 496 0123', '44', '161', '4960123')
|
105
106
|
end
|
106
|
-
|
107
|
-
# Tyneside/Durham
|
107
|
+
|
108
|
+
# Tyneside/Durham
|
108
109
|
#/Sunderland 0191 498 0000 to 498 0999
|
109
110
|
def test_tyneside
|
110
111
|
parse_test('+44 191 496 0123', '44', '191', '4960123')
|
111
112
|
end
|
112
|
-
|
113
|
+
|
113
114
|
## LONG CODES
|
114
|
-
|
115
|
+
|
115
116
|
# 01202 — Bournemouth (BO)
|
116
117
|
def test_bournemouth
|
117
118
|
parse_test('+44 1202 96 0123', '44', '1202', '960123')
|
118
119
|
end
|
119
|
-
|
120
|
+
|
120
121
|
# 01326 — Falmouth (FA)
|
121
122
|
def test_falmouth
|
122
123
|
parse_test('+44 1326 96 0123', '44', '1326', '960123')
|
123
124
|
end
|
124
|
-
|
125
|
+
|
125
126
|
# 01420 — Alton (HA)
|
126
127
|
def test_alton
|
127
128
|
parse_test('+44 1420 96 0123', '44', '1420', '960123')
|
128
129
|
end
|
129
|
-
|
130
|
+
|
130
131
|
# 01598 — Lynton (LY)
|
131
132
|
def test_lynton
|
132
133
|
parse_test('+44 1598 96 0123', '44', '1598', '960123')
|
133
134
|
end
|
134
|
-
|
135
|
+
|
135
136
|
# 01637 — Newquay (NE)
|
136
137
|
def test_newquay
|
137
138
|
parse_test('+44 1637 96 0123', '44', '1637', '960123')
|
138
139
|
end
|
139
|
-
|
140
|
+
|
140
141
|
# 01700 — Rothesay (RO)
|
141
142
|
def test_rothesay
|
142
143
|
parse_test('+44 1700 96 0123', '44', '1700', '960123')
|
143
144
|
end
|
144
|
-
|
145
|
+
|
145
146
|
# 01951 — Colonsay
|
146
147
|
def test_colonsay
|
147
148
|
parse_test('+44 1951 96 0123', '44', '1951', '960123')
|
148
149
|
end
|
149
|
-
|
150
|
+
|
150
151
|
# No area 01632 960000 to 960999
|
151
152
|
def test_no_area
|
152
153
|
parse_test('+44 1632 96 0123', '44', '1632', '960123')
|
153
154
|
end
|
154
|
-
|
155
|
+
|
155
156
|
# Personal numbering 070 xxxx xxxx
|
156
157
|
def test_personal_numbering
|
157
158
|
parse_test('+44 70 00001234', '44', '70', '00001234')
|
158
159
|
end
|
159
|
-
|
160
|
+
|
160
161
|
# Mobile 07700 900000 to 900999
|
161
162
|
def test_mobile
|
162
163
|
parse_test('+44 7700 900345', '44', '7700', '900345')
|
163
164
|
end
|
164
|
-
|
165
|
+
|
165
166
|
def test_mobile_2
|
166
167
|
parse_test('+44 7778 900345', '44', '7778', '900345')
|
167
168
|
end
|
168
|
-
|
169
|
+
|
169
170
|
# Freephone 08081 570000 to 570999
|
170
171
|
def test_freephone
|
171
172
|
parse_test('+44 808 1570123', '44', '808', '1570123')
|
172
173
|
end
|
173
|
-
|
174
|
+
|
174
175
|
def test_freephone_2
|
175
176
|
parse_test('+44 873 1570123', '44', '873', '1570123')
|
176
177
|
end
|
177
|
-
|
178
|
+
|
178
179
|
# Premium Rate Services 0909 8790000 to 8790999
|
179
180
|
def test_premium
|
180
181
|
parse_test('+44 909 8790999', '44', '909', '8790999')
|
181
182
|
end
|
182
|
-
|
183
|
+
|
183
184
|
def test_premium2
|
184
185
|
parse_test('+44 910 8790123', '44', '910', '8790123')
|
185
186
|
end
|
186
|
-
|
187
|
+
|
187
188
|
# UK Wide 03069 990000 to 990999
|
188
189
|
def test_wide
|
189
190
|
parse_test('+44 306 9990123', '44', '306', '9990123')
|
190
191
|
end
|
191
|
-
|
192
|
+
|
192
193
|
def test_wide_2
|
193
194
|
parse_test('+44 339 9990123', '44', '339', '9990123')
|
194
195
|
end
|
195
|
-
|
196
|
+
|
196
197
|
end
|
data/test/countries/hr_test.rb
CHANGED
@@ -1,37 +1,37 @@
|
|
1
|
-
require
|
1
|
+
require "helper"
|
2
2
|
|
3
3
|
## Croatia
|
4
|
-
class HRTest < Test
|
5
|
-
|
4
|
+
class HRTest < Minitest::Test
|
5
|
+
|
6
6
|
def test_zagreb
|
7
7
|
parse_test('+38513668734', '385', '1', '3668734')
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
def test_mobile
|
11
11
|
parse_test('+385915125486', '385', '91', '5125486')
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def test_long_without_special_characters
|
15
15
|
parse_test('+385915125486', '385', '91', '5125486')
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
def test_long_with_special_characters
|
19
19
|
parse_test('+ 385 (91) 512 / 5486 ', '385', '91', '5125486')
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
def test_long_with_leading_zeros
|
23
23
|
parse_test('00385915125486', '385', '91', '5125486')
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
def test_zagreb_long_with_leading_zeros
|
27
27
|
parse_test('0038513668734', '385', '1', '3668734')
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
def test_short_without_special_characters_with_country
|
31
31
|
Phoner::Phone.default_country_code = '385'
|
32
32
|
parse_test('044885047', '385', '44', '885047')
|
33
33
|
end
|
34
|
-
|
34
|
+
|
35
35
|
def test_zagreb_short_without_special_characters_with_country
|
36
36
|
Phoner::Phone.default_country_code = '385'
|
37
37
|
parse_test('013668734', '385', '1', '3668734')
|
@@ -44,15 +44,15 @@ class HRTest < Test::Unit::TestCase
|
|
44
44
|
|
45
45
|
def test_has_default_country_code
|
46
46
|
Phoner::Phone.default_country_code = '385'
|
47
|
-
|
47
|
+
|
48
48
|
assert_equal Phoner::Phone.parse('+38547451588').has_default_country_code?, true
|
49
49
|
assert_equal Phoner::Phone.parse('+38647451588').has_default_country_code?, false
|
50
50
|
end
|
51
|
-
|
51
|
+
|
52
52
|
def test_has_default_area_code
|
53
53
|
Phoner::Phone.default_country_code = '385'
|
54
54
|
Phoner::Phone.default_area_code = '47'
|
55
|
-
|
55
|
+
|
56
56
|
assert_equal Phoner::Phone.parse('047/451-588').has_default_area_code?, true
|
57
57
|
assert_equal Phoner::Phone.parse('032/336-1456').has_default_area_code?, false
|
58
58
|
end
|
@@ -72,5 +72,5 @@ class HRTest < Test::Unit::TestCase
|
|
72
72
|
assert_equal Phoner::Phone.valid?('091-512-54-86'), true
|
73
73
|
assert_equal Phoner::Phone.valid?('047/451-588'), true
|
74
74
|
end
|
75
|
-
|
75
|
+
|
76
76
|
end
|
data/test/countries/hu_test.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
require
|
1
|
+
require "helper"
|
2
2
|
|
3
3
|
## Hungary
|
4
|
-
class HUTest < Test
|
5
|
-
|
4
|
+
class HUTest < Minitest::Test
|
5
|
+
|
6
6
|
def test_mobile
|
7
7
|
parse_test('+36 30 5517999', '36', '30', '5517999')
|
8
|
-
end
|
9
|
-
|
8
|
+
end
|
9
|
+
|
10
10
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require "helper"
|
2
|
+
|
3
|
+
## Ireland
|
4
|
+
class IETest < Minitest::Test
|
5
|
+
|
6
|
+
def test_short_cork_number
|
7
|
+
parse_test('+353 28 28946', '353', '28', '28946')
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_short_cork_number_2
|
11
|
+
parse_test('+353 28 28943', '353', '28', '28943')
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_short_wrong_area_code
|
15
|
+
pp = Phoner::Phone.parse('+353 33023')
|
16
|
+
|
17
|
+
assert_nil pp
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
data/test/countries/nl_test.rb
CHANGED
@@ -1,70 +1,70 @@
|
|
1
|
-
require
|
1
|
+
require "helper"
|
2
2
|
|
3
3
|
## Netherlands
|
4
|
-
class NETest < Test
|
5
|
-
|
4
|
+
class NETest < Minitest::Test
|
5
|
+
|
6
6
|
# 06: mobile phone number
|
7
7
|
def test_mobile
|
8
8
|
parse_test('+31 6 12345678', '31', '6', '12345678')
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
# 066: mobile pagers
|
12
12
|
def test_pagers
|
13
13
|
parse_test('+31 66 1234567', '31', '66', '1234567')
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
# 06760: internet access number
|
17
17
|
def test_internet_access
|
18
18
|
parse_test('+31 6760 12345', '31', '6760', '12345')
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
# 0800: toll free number
|
22
22
|
def test_toll_free
|
23
23
|
parse_test('+31 800 123456', '31', '800', '123456')
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
# 084: location independent (used mostly for fax-to-email and voicemail services)
|
27
27
|
def test_location_independent_84
|
28
28
|
parse_test('+31 84 1234567', '31', '84', '1234567')
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
31
|
# 085: location independent
|
32
32
|
def test_location_independent_85
|
33
33
|
parse_test('+31 85 1234567', '31', '85', '1234567')
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
36
|
# 087: location independent
|
37
37
|
def test_location_independent_87
|
38
38
|
parse_test('+31 87 1234567', '31', '87', '1234567')
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
41
|
# 088: location independent (for companies)
|
42
42
|
def test_location_independent_88
|
43
43
|
parse_test('+31 88 1234567', '31', '88', '1234567')
|
44
44
|
end
|
45
|
-
|
45
|
+
|
46
46
|
# 0878: location independent (voice over IP)
|
47
47
|
def test_location_independent_878
|
48
48
|
parse_test('+31 878 123456', '31', '878', '123456')
|
49
49
|
end
|
50
|
-
|
50
|
+
|
51
51
|
# 0900: premium rate, information
|
52
52
|
def test_premium_900
|
53
53
|
parse_test('+31 900 123456', '31', '900', '123456')
|
54
54
|
end
|
55
|
-
|
55
|
+
|
56
56
|
# 0906: premium rate, erotic
|
57
57
|
def test_premium_906
|
58
58
|
parse_test('+31 906 123456', '31', '906', '123456')
|
59
59
|
end
|
60
60
|
# 0909: premium rate, entertainment
|
61
|
-
|
61
|
+
|
62
62
|
# 112: emergency services number
|
63
63
|
# 14xxx(x): public authorities, where xxxx is the three- or four-digit area-code of the municipality
|
64
64
|
# 18xx: number information
|
65
|
-
|
65
|
+
|
66
66
|
# 01x(x) to 05x(x): geographical area codes
|
67
|
-
|
67
|
+
|
68
68
|
## two digit
|
69
69
|
# 010 Rotterdam
|
70
70
|
def test_rotterdam
|
@@ -75,7 +75,7 @@ class NETest < Test::Unit::TestCase
|
|
75
75
|
parse_test('+31 13 1234567', '31', '13', '1234567')
|
76
76
|
end
|
77
77
|
# 015 Delft
|
78
|
-
|
78
|
+
|
79
79
|
# 020 Amsterdam
|
80
80
|
def test_amsterdam
|
81
81
|
parse_test('+31 20 1234567', '31', '20', '1234567')
|
@@ -83,7 +83,7 @@ class NETest < Test::Unit::TestCase
|
|
83
83
|
# 023 Haarlem
|
84
84
|
# 024 Nijmegen
|
85
85
|
# 026 Arnhem
|
86
|
-
|
86
|
+
|
87
87
|
# 030 Utrecht
|
88
88
|
def test_utrecht
|
89
89
|
parse_test('+31 30 1234567', '31', '30', '1234567')
|
@@ -95,7 +95,7 @@ class NETest < Test::Unit::TestCase
|
|
95
95
|
# 035 Hilversum
|
96
96
|
# 036 Almere
|
97
97
|
# 038 Zwolle
|
98
|
-
|
98
|
+
|
99
99
|
# 040 Eindhoven
|
100
100
|
# 043 Maastricht
|
101
101
|
# 045 Heerlen
|
@@ -103,7 +103,7 @@ class NETest < Test::Unit::TestCase
|
|
103
103
|
parse_test('+31 45 1234567', '31', '45', '1234567')
|
104
104
|
end
|
105
105
|
# 046 Sittard
|
106
|
-
|
106
|
+
|
107
107
|
# 050 Groningen
|
108
108
|
def test_groningen
|
109
109
|
parse_test('+31 50 1234567', '31', '50', '1234567')
|
@@ -114,7 +114,7 @@ class NETest < Test::Unit::TestCase
|
|
114
114
|
def test_leeuwarden
|
115
115
|
parse_test('+31 58 1234567', '31', '58', '1234567')
|
116
116
|
end
|
117
|
-
|
117
|
+
|
118
118
|
# 07x: geographical area codes (cities all over the country)
|
119
119
|
# 070 The Hague
|
120
120
|
def test_the_hague
|
@@ -138,8 +138,8 @@ class NETest < Test::Unit::TestCase
|
|
138
138
|
def test_zoetermeer
|
139
139
|
parse_test('+31 79 1234567', '31', '79', '1234567')
|
140
140
|
end
|
141
|
-
|
142
|
-
|
141
|
+
|
142
|
+
|
143
143
|
## three digit
|
144
144
|
# 0111 Zierikzee
|
145
145
|
def test_zierikzee
|
@@ -156,7 +156,7 @@ class NETest < Test::Unit::TestCase
|
|
156
156
|
parse_test('+31 117 123456', '31', '117', '123456')
|
157
157
|
end
|
158
158
|
# 0118 Middelburg
|
159
|
-
|
159
|
+
|
160
160
|
# 0161 Gilze-Rijen
|
161
161
|
def test_gilze
|
162
162
|
parse_test('+31 161 123456', '31', '161', '123456')
|
@@ -170,13 +170,13 @@ class NETest < Test::Unit::TestCase
|
|
170
170
|
# 0166 Tholen
|
171
171
|
# 0167 Steenbergen
|
172
172
|
# 0168 Zevenbergen
|
173
|
-
|
173
|
+
|
174
174
|
# 0172 Alphen aan den Rijn
|
175
175
|
def test_alphen
|
176
176
|
parse_test('+31 172 123456', '31', '172', '123456')
|
177
177
|
end
|
178
178
|
# 0174 Naaldwijk
|
179
|
-
|
179
|
+
|
180
180
|
# 0180 Ridderkerk
|
181
181
|
def test_ridderkerk
|
182
182
|
parse_test('+31 180 123456', '31', '180', '123456')
|
@@ -190,7 +190,7 @@ class NETest < Test::Unit::TestCase
|
|
190
190
|
# 0184 Sliedrecht
|
191
191
|
# 0186 Oud-Beijerland
|
192
192
|
# 0187 Middelharnis
|
193
|
-
|
193
|
+
|
194
194
|
# 0222 Texel
|
195
195
|
def test_texel
|
196
196
|
parse_test('+31 222 123456', '31', '222', '123456')
|
@@ -207,21 +207,21 @@ class NETest < Test::Unit::TestCase
|
|
207
207
|
def test_hoorn
|
208
208
|
parse_test('+31 229 123456', '31', '229', '123456')
|
209
209
|
end
|
210
|
-
|
210
|
+
|
211
211
|
# 0251 Beverwijk
|
212
212
|
def test_beverwijk
|
213
213
|
parse_test('+31 251 123456', '31', '251', '123456')
|
214
214
|
end
|
215
215
|
# 0252 Hillegom
|
216
216
|
# 0255 IJmuiden
|
217
|
-
|
217
|
+
|
218
218
|
# 0294 Weesp
|
219
219
|
def test_weesp
|
220
220
|
parse_test('+31 294 123456', '31', '294', '123456')
|
221
221
|
end
|
222
222
|
# 0297 Aalsmeer
|
223
223
|
# 0299 Purmerend
|
224
|
-
|
224
|
+
|
225
225
|
# 0313 Dieren
|
226
226
|
def test_dieren
|
227
227
|
parse_test('+31 313 123456', '31', '313', '123456')
|
@@ -234,13 +234,13 @@ class NETest < Test::Unit::TestCase
|
|
234
234
|
# 0316 Zevenaar
|
235
235
|
# 0317 Wageningen
|
236
236
|
# 0318 Ede / Veenendaal
|
237
|
-
|
237
|
+
|
238
238
|
# 0320 Lelystad
|
239
239
|
def test_lelystad
|
240
240
|
parse_test('+31 320 123456', '31', '320', '123456')
|
241
241
|
end
|
242
242
|
# 0321 Dronten
|
243
|
-
|
243
|
+
|
244
244
|
# 0341 Harderwijk
|
245
245
|
def test_harderwijk
|
246
246
|
parse_test('+31 341 123456', '31', '341', '123456')
|
@@ -255,7 +255,7 @@ class NETest < Test::Unit::TestCase
|
|
255
255
|
# 0346 Maarssen
|
256
256
|
# 0347 Vianen
|
257
257
|
# 0348 Woerden
|
258
|
-
|
258
|
+
|
259
259
|
# 0411 Boxtel
|
260
260
|
def test_boxtel
|
261
261
|
parse_test('+31 411 123456', '31', '411', '123456')
|
@@ -264,13 +264,13 @@ class NETest < Test::Unit::TestCase
|
|
264
264
|
# 0413 Veghel
|
265
265
|
# 0416 Waalwijk
|
266
266
|
# 0418 Zaltbommel
|
267
|
-
|
267
|
+
|
268
268
|
# 0475 Roermond
|
269
269
|
def test_roermond
|
270
270
|
parse_test('+31 475 123456', '31', '475', '123456')
|
271
271
|
end
|
272
272
|
# 0478 Venray
|
273
|
-
|
273
|
+
|
274
274
|
# 0481 Bemmel
|
275
275
|
def test_bemmel
|
276
276
|
parse_test('+31 481 123456', '31', '481', '123456')
|
@@ -282,7 +282,7 @@ class NETest < Test::Unit::TestCase
|
|
282
282
|
parse_test('+31 487 123456', '31', '487', '123456')
|
283
283
|
end
|
284
284
|
# 0488 Zetten
|
285
|
-
|
285
|
+
|
286
286
|
# 0492 Helmond
|
287
287
|
def test_helmond
|
288
288
|
parse_test('+31 492 123456', '31', '492', '123456')
|
@@ -294,7 +294,7 @@ class NETest < Test::Unit::TestCase
|
|
294
294
|
end
|
295
295
|
# 0497 Eersel
|
296
296
|
# 0499 Best
|
297
|
-
|
297
|
+
|
298
298
|
# 0511 Veenwouden
|
299
299
|
def test_veenwouden
|
300
300
|
parse_test('+31 511 123456', '31', '511', '123456')
|
@@ -310,7 +310,7 @@ class NETest < Test::Unit::TestCase
|
|
310
310
|
# 0517 Franeker
|
311
311
|
# 0518 St. Annaparochie
|
312
312
|
# 0519 Dokkum
|
313
|
-
|
313
|
+
|
314
314
|
# 0521 Steenwijk
|
315
315
|
def test_steenwijk
|
316
316
|
parse_test('+31 521 123456', '31', '521', '123456')
|
@@ -325,7 +325,7 @@ class NETest < Test::Unit::TestCase
|
|
325
325
|
# 0527 Emmeloord
|
326
326
|
# 0528 Hoogeveen
|
327
327
|
# 0529 Ommen
|
328
|
-
|
328
|
+
|
329
329
|
# 0541 Oldenzaal
|
330
330
|
def test_oldenzaal
|
331
331
|
parse_test('+31 541 123456', '31', '541', '123456')
|
@@ -339,14 +339,14 @@ class NETest < Test::Unit::TestCase
|
|
339
339
|
# 0546 Almelo
|
340
340
|
# 0547 Goor
|
341
341
|
# 0548 Rijssen
|
342
|
-
|
342
|
+
|
343
343
|
# 0561 Wolvega
|
344
344
|
def test_wolvega
|
345
345
|
parse_test('+31 561 123456', '31', '561', '123456')
|
346
346
|
end
|
347
347
|
# 0562 Terschelling/Vlieland
|
348
348
|
# 0566 Irnsum
|
349
|
-
|
349
|
+
|
350
350
|
# 0570 Deventer
|
351
351
|
def test_deventer
|
352
352
|
parse_test('+31 570 123456', '31', '570', '123456')
|
@@ -360,7 +360,7 @@ class NETest < Test::Unit::TestCase
|
|
360
360
|
# 0575 Zutphen
|
361
361
|
# 0577 Uddel
|
362
362
|
# 0578 Epe
|
363
|
-
|
363
|
+
|
364
364
|
# 0591 Emmen
|
365
365
|
def test_emmen
|
366
366
|
parse_test('+31 591 123456', '31', '591', '123456')
|
@@ -379,5 +379,5 @@ class NETest < Test::Unit::TestCase
|
|
379
379
|
def test_stadskanaal
|
380
380
|
parse_test('+31 599 123456', '31', '599', '123456')
|
381
381
|
end
|
382
|
-
|
382
|
+
|
383
383
|
end
|