ibanomat 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +7 -4
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/bin/console +1 -3
- data/ibanomat.gemspec +5 -3
- data/lib/ibanomat/version.rb +1 -1
- metadata +6 -11
- data/spec/ibanomat/client_spec.rb +0 -98
- data/spec/spec_helper.rb +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8a006998103205bf65c2ddf606fff404c517e9fb117cca5131a2fcb2232d620b
|
4
|
+
data.tar.gz: eef9c949dd25f17038a707465a4038e68730de9cd80d27ae2649e659620ed489
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a1850bbef5ca564b76c73d24b70748cfac67663448bcaedf62bb9908fd9f2643ce5a3a9ce0512f682ef03c5b1a388d17a944bc663f77b54ccb5fef4de29950d
|
7
|
+
data.tar.gz: 8de558f98ab2c8147ef6f24fc0da9d27539b00acb7638a6726b9f03e2e7d971a75477f4dfc9bff3a9b7729d64a3ed29dbfcf305b0b796a5ac9979f584f1b362c
|
data/.travis.yml
CHANGED
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2013-
|
3
|
+
Copyright (c) 2013-2018 Georg Ledermann
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
6
|
this software and associated documentation files (the "Software"), to deal in
|
data/README.md
CHANGED
data/bin/console
CHANGED
data/ibanomat.gemspec
CHANGED
@@ -13,9 +13,11 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = 'http://github.com/ledermann/ibanomat'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
16
|
-
spec.files = `git ls-files`.split(
|
17
|
-
|
18
|
-
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
|
+
f.match(%r{^(test|spec|features)/})
|
18
|
+
end
|
19
|
+
spec.bindir = 'exe'
|
20
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
21
|
spec.require_paths = ['lib']
|
20
22
|
|
21
23
|
spec.required_ruby_version = '>= 2.0.0'
|
data/lib/ibanomat/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ibanomat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Georg Ledermann
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -69,8 +69,7 @@ dependencies:
|
|
69
69
|
description: 'Germany only: Bankleitzahl & Kontonummer => IBAN'
|
70
70
|
email:
|
71
71
|
- mail@georg-ledermann.de
|
72
|
-
executables:
|
73
|
-
- console
|
72
|
+
executables: []
|
74
73
|
extensions: []
|
75
74
|
extra_rdoc_files: []
|
76
75
|
files:
|
@@ -86,8 +85,6 @@ files:
|
|
86
85
|
- lib/ibanomat.rb
|
87
86
|
- lib/ibanomat/client.rb
|
88
87
|
- lib/ibanomat/version.rb
|
89
|
-
- spec/ibanomat/client_spec.rb
|
90
|
-
- spec/spec_helper.rb
|
91
88
|
homepage: http://github.com/ledermann/ibanomat
|
92
89
|
licenses:
|
93
90
|
- MIT
|
@@ -108,10 +105,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
105
|
version: '0'
|
109
106
|
requirements: []
|
110
107
|
rubyforge_project:
|
111
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.7.6
|
112
109
|
signing_key:
|
113
110
|
specification_version: 4
|
114
111
|
summary: Wrapper for a web service to calculate the IBAN of german bank account numbers
|
115
|
-
test_files:
|
116
|
-
- spec/ibanomat/client_spec.rb
|
117
|
-
- spec/spec_helper.rb
|
112
|
+
test_files: []
|
@@ -1,98 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Ibanomat do
|
4
|
-
describe :find do
|
5
|
-
subject {
|
6
|
-
Ibanomat.find :bank_code => '37040044', :bank_account_number => '0532013000'
|
7
|
-
}
|
8
|
-
|
9
|
-
context 'Webservice is live' do
|
10
|
-
context 'returns valid IBAN' do
|
11
|
-
before :each do
|
12
|
-
json_response = {
|
13
|
-
'Institutsname' => 'Commerzbank',
|
14
|
-
'BIC' => 'COBADEFFXXX',
|
15
|
-
'BLZ' => '37040044',
|
16
|
-
'IBAN' => 'DE89370400440532013000',
|
17
|
-
'KtoNr' => '0532013000',
|
18
|
-
'RetCode' => '00'
|
19
|
-
}.to_json
|
20
|
-
|
21
|
-
stub_request(:get, Ibanomat::URL).
|
22
|
-
with(:query => {
|
23
|
-
'b' => '37040044',
|
24
|
-
'a' => '0532013000'
|
25
|
-
}).
|
26
|
-
to_return(:status => 200, :body => json_response)
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'should return bank_name' do
|
30
|
-
expect(subject[:bank_name]).to eq('Commerzbank')
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'should return BIC' do
|
34
|
-
expect(subject[:bic]).to eq('COBADEFFXXX')
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'should return IBAN' do
|
38
|
-
expect(subject[:iban]).to eq('DE89370400440532013000')
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
context 'can not calculate IBAN' do
|
43
|
-
before :each do
|
44
|
-
json_response = {
|
45
|
-
'BLZ' => '37040044',
|
46
|
-
'KtoNr' => '0532013000',
|
47
|
-
'RetCode' => '10'
|
48
|
-
}.to_json
|
49
|
-
|
50
|
-
stub_request(:get, Ibanomat::URL).
|
51
|
-
with(:query => {
|
52
|
-
'b' => '37040044',
|
53
|
-
'a' => '0532013000'
|
54
|
-
}).
|
55
|
-
to_return(:status => 200, :body => json_response)
|
56
|
-
end
|
57
|
-
|
58
|
-
it 'should return error code' do
|
59
|
-
expect(subject[:return_code]).to eq('10')
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
context 'Webservice not found' do
|
65
|
-
before :each do
|
66
|
-
stub_request(:get, Ibanomat::URL).
|
67
|
-
with(:query => {
|
68
|
-
'b' => '37040044',
|
69
|
-
'a' => '0532013000'
|
70
|
-
}).
|
71
|
-
to_return(:status => 404)
|
72
|
-
end
|
73
|
-
|
74
|
-
it 'should raise exception' do
|
75
|
-
expect {
|
76
|
-
subject
|
77
|
-
}.to raise_error(Ibanomat::ResourceNotFoundError)
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
context 'Webservice does not respond' do
|
82
|
-
before :each do
|
83
|
-
stub_request(:get, Ibanomat::URL).
|
84
|
-
with(:query => {
|
85
|
-
'b' => '37040044',
|
86
|
-
'a' => '0532013000'
|
87
|
-
}).
|
88
|
-
to_timeout
|
89
|
-
end
|
90
|
-
|
91
|
-
it 'should raise exception' do
|
92
|
-
expect {
|
93
|
-
subject
|
94
|
-
}.to raise_error(Timeout::Error)
|
95
|
-
end
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
-
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
-
# Require this file using `require "spec_helper"` to ensure that it is only
|
4
|
-
# loaded once.
|
5
|
-
#
|
6
|
-
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
7
|
-
RSpec.configure do |config|
|
8
|
-
config.run_all_when_everything_filtered = true
|
9
|
-
config.filter_run :focus
|
10
|
-
|
11
|
-
# Run specs in random order to surface order dependencies. If you find an
|
12
|
-
# order dependency and want to debug it, you can fix the order by providing
|
13
|
-
# the seed, which is printed after each run.
|
14
|
-
# --seed 1234
|
15
|
-
config.order = 'random'
|
16
|
-
end
|
17
|
-
|
18
|
-
require 'ibanomat'
|
19
|
-
require 'webmock/rspec'
|