big-phoney 0.0.2 → 0.0.3

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.
data/big-phoney.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{big-phoney}
5
- s.version = "0.0.2"
5
+ s.version = "0.0.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Pat Nakajima"]
data/lib/big-phoney.rb CHANGED
@@ -86,8 +86,10 @@ class PhoneNumber
86
86
  errors << :country_code
87
87
  end
88
88
 
89
- if @number.size < MINLEN
90
- errors << :too_short
89
+ if @country_code == '1'
90
+ errors << :too_short if @number.size < MIN_US_LENGTH
91
+ else
92
+ errors << :too_short if @number.size <= MINLEN
91
93
  end
92
94
  end
93
95
  end
@@ -20,7 +20,7 @@ describe PhoneNumber do
20
20
  end
21
21
 
22
22
  it "is invalid when too short" do
23
- number = PhoneNumber.new('423432123')
23
+ number = PhoneNumber.new('535341345')
24
24
  number.should_not be_valid
25
25
  number.errors.should include(:too_short)
26
26
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: big-phoney
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pat Nakajima