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: 27772c4f904fa7473c085f4eaeb744b6e635842e
4
- data.tar.gz: 10291d3750613c7a2d28690467f92552bfc43e38
3
+ metadata.gz: 13d8c3769df4f32a061f862231db237b7c0f4302
4
+ data.tar.gz: fa6a908f00939f7180727ae9efffef6984862834
5
5
  SHA512:
6
- metadata.gz: b74ba523b6f04a9ff84b71130957ed9c439f77a08226a895b18e4aa45875d2f192615c51fd45ab687d17383f21e00d9af7a709240680825694e1f848afe24fa7
7
- data.tar.gz: 88bfd756dc04733d3f5cd9c7d7d09df260080b409021d9e69385fdd672cd543d1a8a7d284ea28e2d46366d3cfa2b1d9de70b173b391bb827f362cabcad28d495
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
 
@@ -1,3 +1,3 @@
1
1
  module KawaiiEmailAddress
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -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' }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kawaii_email_address
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - moro