cnpj_validator 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |s|
3
3
  s.name = "cnpj_validator"
4
- s.version = "0.3.0"
4
+ s.version = "0.3.1"
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = ["Gabriel Sobrinho"]
7
7
  s.email = ["gabriel.sobrinho@gmail.com"]
@@ -6,7 +6,7 @@ class CnpjValidator::Cnpj
6
6
  attr_reader :number
7
7
 
8
8
  def initialize(number)
9
- @number = number
9
+ @number = number.to_s
10
10
  end
11
11
 
12
12
  def digits
@@ -15,6 +15,12 @@ class CnpjValidatorTest < Test::Unit::TestCase
15
15
  assert_invalid '03.971.701/5859-70'
16
16
  end
17
17
 
18
+ def test_blank_values
19
+ assert_invalid ''
20
+ assert_invalid false
21
+ assert_invalid nil
22
+ end
23
+
18
24
  def test_masked
19
25
  assert_valid '38.417.923/0001-16'
20
26
  assert_valid '43.010.889/0001-09'
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: cnpj_validator
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.0
5
+ version: 0.3.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Gabriel Sobrinho
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-02 00:00:00 -03:00
13
+ date: 2011-07-04 00:00:00 -03:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency