validates_zipcode 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/validates_zipcode/cldr_regex_collection.rb +1 -1
- data/lib/validates_zipcode/version.rb +1 -1
- data/spec/validates_zipcode_spec.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf10d7923790f275f72651452d63b08204c323ac
|
4
|
+
data.tar.gz: e933362da9fe6d1d7f0d390061d2008daef6a864
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e86d3408de58bec92855c0cc605534891862e79689b10f613086fc179be7c9043bbfee7e4e80db71de525474e906c3988ab42a5e4e86a218e4b4cee382af8dd0
|
7
|
+
data.tar.gz: 38ca9144c735aa01885df93c351a8d1c7e68b94ae0523818d94262b7a18a8a8d049343fc5e46efe2aae1fd4b7c1afe1c6924792126714d32a79910ca1fe7431e
|
data/CHANGELOG.md
CHANGED
@@ -148,7 +148,7 @@ module ValidatesZipcode
|
|
148
148
|
BI: /\A([a-zA-Z\d\s]){3,}\z/,
|
149
149
|
BS: /\A([a-zA-Z\d\s]){3,}\z/,
|
150
150
|
BZ: /\A([a-zA-Z\d\s]){3,}\z/,
|
151
|
-
BR: /\A\d{
|
151
|
+
BR: /\A\d{5}(-?\d{3})?\z/,
|
152
152
|
BJ: /\A([a-zA-Z\d\s]){3,}\z/,
|
153
153
|
BT: /\A\d{5}\z/,
|
154
154
|
BQ: /\A([a-zA-Z\d\s]){3,}\z/,
|
@@ -152,6 +152,20 @@ describe ValidatesZipcode, '#validate_each' do
|
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
155
|
+
context 'Brazil' do
|
156
|
+
it 'validates with a valid zipcode' do
|
157
|
+
['72315', '72315-500', '72315500', '24210-325', '24210325'].each do |zipcode|
|
158
|
+
record = build_record(zipcode, 'BR')
|
159
|
+
zipcode_should_be_valid(record)
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
it 'does not validate with an invalid zipcode' do
|
164
|
+
record = build_record('723155', 'BR')
|
165
|
+
zipcode_should_be_invalid(record)
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
155
169
|
context 'Czech' do
|
156
170
|
it 'validates with a valid zipcode' do
|
157
171
|
['12000', '721 00'].each do |zipcode|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: validates_zipcode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Gil
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|