phony 2.12.7 → 2.12.8
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/lib/phony/countries/italy.rb +1 -1
- data/spec/functional/format_spec.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fa0e706a618d0a9b1a60f0256ad496743c52235
|
4
|
+
data.tar.gz: a483882673bc99b4d88b82ffadad0cc7465557b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fda7a75e5097c61a0df6a60fc254be719e0f2157dbd57c3ce45d96972fd13835773ba2b79e2a52f073a01bd81e4196ae3c8a4b607fe98144f621d615841ac585
|
7
|
+
data.tar.gz: ed85fd7b00cd8a7ae12185e272fb483380ece8e52fc32f7c6a7e6432973f0df94e75bafde1d6533cc3546a8e19ff218db332a0bb0ad8a45c4d4f68da7a92ec4c
|
@@ -264,7 +264,7 @@ service = [ # Not exhaustive.
|
|
264
264
|
]
|
265
265
|
|
266
266
|
Phony.define do
|
267
|
-
country '39', trunk('
|
267
|
+
country '39', trunk('', :normalize => false) |
|
268
268
|
one_of(*service) >> split(3,3) |
|
269
269
|
one_of(*mobile) >> split(3,4,-1..1) |
|
270
270
|
one_of(*ndcs_2digit) >> split(4,4) |
|
@@ -118,6 +118,10 @@ describe 'Phony#format' do
|
|
118
118
|
it 'formats french numbers' do
|
119
119
|
Phony.format('33142278186', :format => :+, :spaces => '').should eql '+33142278186'
|
120
120
|
end
|
121
|
+
it 'formats italian numbers' do
|
122
|
+
Phony.format('393333337647', :format => :international).should eql '+39 333 333 7647'
|
123
|
+
Phony.format('390108480161', :format => :international).should eql '+39 010 8480161'
|
124
|
+
end
|
121
125
|
it 'formats austrian numbers' do
|
122
126
|
Phony.format('43198110', :format => :international_relative, :spaces => '').should eql '0043198110'
|
123
127
|
end
|
@@ -164,6 +168,10 @@ describe 'Phony#format' do
|
|
164
168
|
end
|
165
169
|
end
|
166
170
|
describe 'national' do
|
171
|
+
it 'formats italian numbers' do
|
172
|
+
Phony.format('393333337647', :format => :national).should eql '333 333 7647'
|
173
|
+
Phony.format('390108480161', :format => :national).should eql '010 8480161'
|
174
|
+
end
|
167
175
|
it 'formats swiss numbers' do
|
168
176
|
Phony.format('41443643532', :format => :national).should eql '044 364 35 32'
|
169
177
|
end
|