validate_nz_bank_acc 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG +1 -0
- data/LICENSE +2 -1
- data/README.md +9 -0
- data/lib/validate_nz_bank_acc/version.rb +1 -1
- data/spec/validate_nz_bank_acc_spec.rb +13 -14
- data/validate_nz_bank_acc.gemspec +3 -3
- metadata +22 -22
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6107d07189a0b6889fe1e5094b09507eebff5561156c571db256dddec98438d4
|
4
|
+
data.tar.gz: d5ee53b454cc8cc9bbd87efa0ea701bde771af1174731fa89ec97e69a45adb6c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: '0338facbb85efeadc8cee3dd0f9c7bd7f9d127e695130fb7e3c199b6f04238f514e27f0b71fe1609caeffe191a41e6c3e27b1022a73edc5c68c5f06468d45b30'
|
7
|
+
data.tar.gz: e8bc759f4229e4984263ae7e554031e35a110841b584f8607bda1d9d206ddf8977f8b226694fd41fa03308efc5cc4e6d832ba0a39c23bfd22957fe8797a0957f
|
data/CHANGELOG
CHANGED
data/LICENSE
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
Copyright (c) 2012 Localist Ltd.
|
2
|
+
Copyright (c) 2015 Eaden McKee
|
2
3
|
|
3
4
|
MIT License
|
4
5
|
|
@@ -19,4 +20,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
20
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
21
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
22
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -28,3 +28,12 @@ Or install it yourself as:
|
|
28
28
|
3. Commit your changes (`git commit -am 'Added some feature'`)
|
29
29
|
4. Push to the branch (`git push origin my-new-feature`)
|
30
30
|
5. Create new Pull Request
|
31
|
+
|
32
|
+
|
33
|
+
## History
|
34
|
+
|
35
|
+
This was originaly developed my myself + others at Localist and released under the MIT licence.
|
36
|
+
|
37
|
+
## TODO
|
38
|
+
|
39
|
+
Update specs from 2012 era syntax
|
@@ -5,27 +5,26 @@ describe ValidateNzBankAcc do
|
|
5
5
|
let(:ex2) { ValidateNzBankAcc.new("08","6523","1954512","001") }
|
6
6
|
let(:ex3) { ValidateNzBankAcc.new("26","2600","0320871","032") }
|
7
7
|
|
8
|
-
|
9
8
|
describe "valid_bank_code?" do
|
10
9
|
it "should check against BANKS for the bank code" do
|
11
|
-
ValidateNzBankAcc.new("03","0123","0034141","03").valid_bank_code?.should
|
12
|
-
ValidateNzBankAcc.new("01","1113","0034141","03").valid_bank_code?.should
|
13
|
-
ValidateNzBankAcc.new("20","0123","1111111","11").valid_bank_code?.should
|
14
|
-
ValidateNzBankAcc.new("05","0123","0034141","03").valid_bank_code?.should
|
10
|
+
ValidateNzBankAcc.new("03","0123","0034141","03").valid_bank_code?.should be_truthy
|
11
|
+
ValidateNzBankAcc.new("01","1113","0034141","03").valid_bank_code?.should be_truthy
|
12
|
+
ValidateNzBankAcc.new("20","0123","1111111","11").valid_bank_code?.should be_truthy
|
13
|
+
ValidateNzBankAcc.new("05","0123","0034141","03").valid_bank_code?.should be_falsy # no back 05
|
15
14
|
end
|
16
15
|
end
|
17
16
|
|
18
17
|
describe "valid_bank_branch?" do
|
19
18
|
it "should validate the branch code against the range of valid branches" do
|
20
19
|
# VALIDS
|
21
|
-
ValidateNzBankAcc.new("03","0123","0034141","03").valid_branch_code?.should
|
22
|
-
ValidateNzBankAcc.new("26","2600","0034141","03").valid_branch_code?.should
|
23
|
-
ValidateNzBankAcc.new("26","2699","0034141","0003").valid_branch_code?.should
|
24
|
-
ValidateNzBankAcc.new("11","6666","0034141","0003").valid_branch_code?.should
|
20
|
+
ValidateNzBankAcc.new("03","0123","0034141","03").valid_branch_code?.should be_truthy
|
21
|
+
ValidateNzBankAcc.new("26","2600","0034141","03").valid_branch_code?.should be_truthy
|
22
|
+
ValidateNzBankAcc.new("26","2699","0034141","0003").valid_branch_code?.should be_truthy
|
23
|
+
ValidateNzBankAcc.new("11","6666","0034141","0003").valid_branch_code?.should be_truthy
|
25
24
|
|
26
25
|
# INVALIDS
|
27
|
-
ValidateNzBankAcc.new("11","1111","0034141","0003").valid_branch_code?.should
|
28
|
-
ValidateNzBankAcc.new("01","2012","0034141","0003").valid_branch_code?.should
|
26
|
+
ValidateNzBankAcc.new("11","1111","0034141","0003").valid_branch_code?.should be_falsy
|
27
|
+
ValidateNzBankAcc.new("01","2012","0034141","0003").valid_branch_code?.should be_falsy
|
29
28
|
end
|
30
29
|
end
|
31
30
|
|
@@ -64,9 +63,9 @@ describe ValidateNzBankAcc do
|
|
64
63
|
|
65
64
|
describe "valid_modulo?" do
|
66
65
|
it "should valid modulo for the example in the pdf" do
|
67
|
-
ex1.valid_modulo?.should
|
68
|
-
ex1.valid_modulo?.should
|
69
|
-
ex1.valid_modulo?.should
|
66
|
+
ex1.valid_modulo?.should be_truthy
|
67
|
+
ex1.valid_modulo?.should be_truthy
|
68
|
+
ex1.valid_modulo?.should be_truthy
|
70
69
|
end
|
71
70
|
end
|
72
71
|
end
|
@@ -3,11 +3,11 @@ require File.expand_path('../lib/validate_nz_bank_acc/version', __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.authors = ["Eaden McKee"]
|
6
|
-
gem.email = ["
|
6
|
+
gem.email = ["mail@eaden.net"]
|
7
7
|
gem.description = %q{Validates a NZ bank account against checksum rules}
|
8
8
|
gem.summary = %q{Validates a NZ bank account against checksum rules}
|
9
|
-
gem.homepage = "https://github.com/
|
10
|
-
|
9
|
+
gem.homepage = "https://github.com/eadz/ValidateNzBankAcc"
|
10
|
+
gem.license = "MIT"
|
11
11
|
gem.files = `git ls-files`.split($\)
|
12
12
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
13
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
metadata
CHANGED
@@ -1,35 +1,37 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: validate_nz_bank_acc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Eaden McKee
|
9
|
-
autorequire:
|
8
|
+
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2023-03-24 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rspec
|
16
|
-
requirement:
|
17
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
25
27
|
description: Validates a NZ bank account against checksum rules
|
26
28
|
email:
|
27
|
-
-
|
29
|
+
- mail@eaden.net
|
28
30
|
executables: []
|
29
31
|
extensions: []
|
30
32
|
extra_rdoc_files: []
|
31
33
|
files:
|
32
|
-
- .gitignore
|
34
|
+
- ".gitignore"
|
33
35
|
- CHANGELOG
|
34
36
|
- Gemfile
|
35
37
|
- LICENSE
|
@@ -40,31 +42,29 @@ files:
|
|
40
42
|
- spec/spec_helper.rb
|
41
43
|
- spec/validate_nz_bank_acc_spec.rb
|
42
44
|
- validate_nz_bank_acc.gemspec
|
43
|
-
homepage: https://github.com/
|
44
|
-
licenses:
|
45
|
-
|
45
|
+
homepage: https://github.com/eadz/ValidateNzBankAcc
|
46
|
+
licenses:
|
47
|
+
- MIT
|
48
|
+
metadata: {}
|
49
|
+
post_install_message:
|
46
50
|
rdoc_options: []
|
47
51
|
require_paths:
|
48
52
|
- lib
|
49
53
|
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
54
|
requirements:
|
52
|
-
- -
|
55
|
+
- - ">="
|
53
56
|
- !ruby/object:Gem::Version
|
54
57
|
version: '0'
|
55
58
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
-
none: false
|
57
59
|
requirements:
|
58
|
-
- -
|
60
|
+
- - ">="
|
59
61
|
- !ruby/object:Gem::Version
|
60
62
|
version: '0'
|
61
63
|
requirements: []
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
specification_version: 3
|
64
|
+
rubygems_version: 3.4.5
|
65
|
+
signing_key:
|
66
|
+
specification_version: 4
|
66
67
|
summary: Validates a NZ bank account against checksum rules
|
67
68
|
test_files:
|
68
69
|
- spec/spec_helper.rb
|
69
70
|
- spec/validate_nz_bank_acc_spec.rb
|
70
|
-
has_rdoc:
|