banking_data_validator 0.0.4 → 0.0.5
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.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDcyMmY3ZGIyMDZlMGNhODc1ZWY3Mjg0M2Q3YjY2Yjg3MGVkNGJkNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OGMxZGYxMDI5YWU1OTUxOTA3ODk2YTY2ZDdhYzg2MDBjYWU5ZWIwNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGRiYzg4YzQwNGE1YTAzNmI5ZDVjYmY1YmJhODA5ZDZiZmE0ZDEwMDI4ZjNl
|
10
|
+
NjA2YjcyZjUzOTYxMjVmNDgyZDcwM2M2NjQ4MmRlODE0ODA0YWU3ZDM5OTQw
|
11
|
+
MzdhOWUxMjNlMTk0ZTNhNzVjYWQ5MTIyODRkZDc5MjdhZmFkZWE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWUyNTU3ZmEwZGVhM2JjZjA5YzE4MGM5YWY1MTE5Nzc3ZDYzY2ZkZDIxNDRj
|
14
|
+
N2JjN2I2Mzg0YTc0ODU3MDQyMmFjNzAxMmQ4Y2Y0OWE3Y2VlNmE0OTE0Nzg3
|
15
|
+
MTAzYmUxNjk5ZmZiNzY5ODM4MzdjNWJhMzFkZTFlMWI4MDEzMzU=
|
@@ -6,11 +6,11 @@ module BankingDataValidator
|
|
6
6
|
private
|
7
7
|
|
8
8
|
def checksum
|
9
|
-
"#{raw_checksum %
|
9
|
+
"#{raw_checksum % 10}"
|
10
10
|
end
|
11
11
|
|
12
12
|
def raw_checksum
|
13
|
-
@raw_checksum ||= multiply_factors * 10
|
13
|
+
@raw_checksum ||= multiply_factors * 10 % 11
|
14
14
|
end
|
15
15
|
|
16
16
|
def factors
|
@@ -9,6 +9,8 @@ module BankingDataValidator
|
|
9
9
|
expect(Caixa.valid_account?("1314", "01300169300", "1")).to eq(true)
|
10
10
|
expect(Caixa.valid_account?(268, "00100030339", "5")).to eq(true)
|
11
11
|
expect(Caixa.valid_account?("3498", "00100021718", "8")).to eq(true)
|
12
|
+
expect(Caixa.valid_account?("0821", "00100020502", "0")).to eq(true)
|
13
|
+
expect(Caixa.valid_account?("0008", "01300060386", "0")).to eq(true)
|
12
14
|
end
|
13
15
|
|
14
16
|
it "returns false when is given an account_number with an invalid digit" do
|
data/spec/spec_helper.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
if ENV['CODECLIMATE_REPO_TOKEN']
|
4
|
+
require "codeclimate-test-reporter"
|
5
|
+
CodeClimate::TestReporter.start
|
6
|
+
end
|
5
7
|
|
6
8
|
# This file was generated by the `rspec --init` command. Conventionally, all
|
7
9
|
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: banking_data_validator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Americo Duarte
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|