ibandit 0.4.1 → 0.4.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: 13fadf39c8623f0ec3df9cef2b34e1b96b590f56
4
- data.tar.gz: 64ebdb3aa4e4160fcc33ce1c0f52ab75b8c80865
3
+ metadata.gz: e111a4944bba7c9a8077ea70d7a7d7215d1e7021
4
+ data.tar.gz: e0c2e9b2e45385821107e4d4fac61ed1a39d531d
5
5
  SHA512:
6
- metadata.gz: c6a1bff08fa9a2c135b7585154c9786a252d817c8f4d18659d0fc95165ad697938d34e5d70626d202064e941f1d16d844d1da2fe6074b4ad557002a751377d61
7
- data.tar.gz: e77925edcff34a72037dd57deb84bc530ce11779a92ce8ce98d02b70ee2e197288a5b8d47b58b42c4e34e0930572b336f73099b7bf6852489aef81452414c52f
6
+ metadata.gz: 6d81d40958cfe6397b2ae15b88ec4d27638c8da1651c8da6f0ed791c6c6e2ed016f1b1e7fb29bd2a438aad93335289ba7341ec894f6d774c7ae9526530518bf7
7
+ data.tar.gz: de83146c2c3646982550bd44634696223280e9f18fd48268813a3965dc6fd383af41a32900df98f9ff4821e859b7b09f4a2600f6ba3b575ad97400a7fdf55a6f
@@ -1,3 +1,7 @@
1
+ ## 0.4.2 - May 19, 2015
2
+
3
+ - Bug fix for `CheckDigit.belgian` by [@isaacseymour](https://github.com/isaacseymour)
4
+
1
5
  ## 0.4.1 - April 28, 2015
2
6
 
3
7
  - Add Spanish translation by [@alan](https://github.com/alan), [@sinjo](https://github.com/sinjo) and Jess Milligan
@@ -63,7 +63,8 @@ module Ibandit
63
63
  # of a Belgian account number when given the first ten digits.
64
64
  def self.belgian(string)
65
65
  remainder = string.to_i % 97
66
- format('%02d', remainder)
66
+ return format('%02d', remainder) unless remainder.zero?
67
+ "97"
67
68
  end
68
69
 
69
70
  # Currently unused in this gem. This method calculates the last digit
@@ -1,3 +1,3 @@
1
1
  module Ibandit
2
- VERSION = '0.4.1'.freeze
2
+ VERSION = '0.4.2'.freeze
3
3
  end
@@ -39,6 +39,18 @@ describe Ibandit::CheckDigit do
39
39
  end
40
40
  end
41
41
 
42
+ describe '.belgian' do
43
+ subject { described_class.belgian(account_number) }
44
+
45
+ let(:account_number) { '5100075470' }
46
+ it { is_expected.to eq('61') }
47
+
48
+ context 'with an account number which is a factor of 97' do
49
+ let(:account_number) { '1030343409' }
50
+ it { is_expected.to eq('97') }
51
+ end
52
+ end
53
+
42
54
  describe '.lund' do
43
55
  subject { described_class.lund(account_number) }
44
56
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibandit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grey Baker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-28 00:00:00.000000000 Z
11
+ date: 2015-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -164,8 +164,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  version: '0'
165
165
  requirements: []
166
166
  rubyforge_project:
167
- rubygems_version: 2.2.2
167
+ rubygems_version: 2.4.1
168
168
  signing_key:
169
169
  specification_version: 4
170
170
  summary: Convert national banking details into IBANs, and vice-versa.
171
171
  test_files: []
172
+ has_rdoc: