kawaii_email_address 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13d8c3769df4f32a061f862231db237b7c0f4302
|
4
|
+
data.tar.gz: fa6a908f00939f7180727ae9efffef6984862834
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f37d0792c6c8703728b5d2e8e3a32b8d21799ccdfb22c15ff8f6ec82675dc4152e2269c9da6766aa5d1eada93d5a79d29e20bff65601dcf86d1565b2486a3c82
|
7
|
+
data.tar.gz: 7e9f8b6e71a07051587c25a194ece8b1964c19a55b87f4f180d1ea6878815e84441b77eeed06d944744105344328755314e4d4ae95c5fc7a48bbe54aa24a8012
|
@@ -24,13 +24,17 @@ module KawaiiEmailAddress
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def valid?
|
27
|
-
valid_local_part? && valid_domain_part?
|
27
|
+
both_part_present? && valid_local_part? && valid_domain_part?
|
28
28
|
end
|
29
29
|
|
30
30
|
def to_s
|
31
31
|
[local_part, domain_part].join('@')
|
32
32
|
end
|
33
33
|
|
34
|
+
def both_part_present?
|
35
|
+
local_part && domain_part
|
36
|
+
end
|
37
|
+
|
34
38
|
def valid_local_part?
|
35
39
|
return false if invalid_period_position?
|
36
40
|
|
@@ -21,6 +21,8 @@ describe KawaiiEmailAddress::Validator do
|
|
21
21
|
it { should pass_validation_with '"a@a"@example.com' }
|
22
22
|
it { should pass_validation_with "'or'1'='1'--@example.com" }
|
23
23
|
|
24
|
+
it { should_not pass_validation_with 'example_address' }
|
25
|
+
|
24
26
|
context 'kawaii: aka.docomo' do
|
25
27
|
it { should pass_validation_with 'mail..example@docomo.ne.jp' }
|
26
28
|
it { should pass_validation_with 'example.@docomo.ne.jp' }
|