yapv 0.0.1 → 0.0.2

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/lib/yapv/pesel.rb CHANGED
@@ -10,6 +10,10 @@ module Yapv
10
10
  self.value = value
11
11
  end
12
12
 
13
+ def value=(input)
14
+ @value = input.to_s
15
+ end
16
+
13
17
  def pesel_format
14
18
  mask = [1, 3, 7, 9, 1, 3, 7, 9, 1, 3]
15
19
  val = value.split("").map(&:to_i)
data/lib/yapv/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Yapv
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/test/pesel_test.rb CHANGED
@@ -1,6 +1,11 @@
1
1
  require "test_helper"
2
2
  require "date"
3
3
  class PeselTest < MiniTest::Unit::TestCase
4
+ def test_input_is_automatically_changed_to_string
5
+ @pesel = Yapv::Pesel.new(12345678901)
6
+ assert_equal "12345678901", @pesel.value
7
+ end
8
+
4
9
  def test_pesel_shorter_than_11_digits_is_invalid
5
10
  @pesel = Yapv::Pesel.new("1" * 10)
6
11
  assert !@pesel.valid?
@@ -86,9 +91,4 @@ class PeselTest < MiniTest::Unit::TestCase
86
91
  @pesel.female?
87
92
  end
88
93
  end
89
-
90
- def test_dupa
91
- @pesel = Yapv::Pesel.new("44051401359")
92
- raise @pesel.birth_date.inspect
93
- end
94
94
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yapv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-10 00:00:00.000000000 Z
12
+ date: 2012-05-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
16
- requirement: &70228462292640 !ruby/object:Gem::Requirement
16
+ requirement: &70203813268380 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70228462292640
24
+ version_requirements: *70203813268380
25
25
  description: ''
26
26
  email:
27
27
  - michal.krzyzanowski+github@gmail.com