snils 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/lib/snils.rb +2 -2
- data/lib/snils/version.rb +1 -1
- data/spec/snils_spec.rb +2 -2
- 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: 77cae4842c7d2d690759f9399e75d65fea06359d
|
4
|
+
data.tar.gz: 0bf287d98e0e2d516553fb49903cc6d3178d8117
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd6cf178bc235f330ab2e6f80f2fc37a692aba66cf1ef46dfa144418f30dc3399164b8a94ee9ede2a7e64b44dbe8335ccd41b7ae57a4337cd622f135df87e942
|
7
|
+
data.tar.gz: 8d87e7e1cb501d9b15591e69db5239a64e4e180f22f9f29fcc64c21769a77915c1dbeb6e44265c160c5fd3245e6b42947f0fad4fc6cf6c3108c1bd10647d3cb0
|
data/.travis.yml
CHANGED
data/lib/snils.rb
CHANGED
@@ -71,8 +71,8 @@ class Snils
|
|
71
71
|
protected
|
72
72
|
|
73
73
|
def validate
|
74
|
-
@errors << [:wrong_length, :count => 11] unless @snils.length == 11
|
75
|
-
@errors << :invalid
|
74
|
+
@errors << [:wrong_length, {:count => 11}] unless @snils.length == 11
|
75
|
+
@errors << :invalid unless @snils[-2..-1] == self.checksum
|
76
76
|
@validated = true
|
77
77
|
end
|
78
78
|
|
data/lib/snils/version.rb
CHANGED
data/spec/snils_spec.rb
CHANGED
@@ -68,12 +68,12 @@ describe Snils do
|
|
68
68
|
|
69
69
|
it 'should not validate invalid snils (with wrong length)' do
|
70
70
|
snils = described_class.new('963-117-158 080')
|
71
|
-
expect(snils.errors).to include [:wrong_length, :count => 11]
|
71
|
+
expect(snils.errors).to include [:wrong_length, {:count => 11}]
|
72
72
|
end
|
73
73
|
|
74
74
|
it 'should not validate invalid snils (with wrong length)' do
|
75
75
|
snils = described_class.new('963-117-158')
|
76
|
-
expect(snils.errors).to include [:wrong_length, :count => 11]
|
76
|
+
expect(snils.errors).to include [:wrong_length, {:count => 11}]
|
77
77
|
end
|
78
78
|
|
79
79
|
end
|