ibandit 0.9.1 → 0.10.0

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e021aa97b6141c2715995c7589009188c4808050
4
- data.tar.gz: 45a31d572ba532971fea7de81f5609c11a5daa8c
3
+ metadata.gz: d98d0e6148aa8b276eb107e70a0fa9967b0720dd
4
+ data.tar.gz: 8102f44a3a4dfabb24658cc5ff9e5a9efea2ec45
5
5
  SHA512:
6
- metadata.gz: a04adebd2ec4e94b40d3715b2803044a7f5f524a03eacb3dbf02d86e20606fe53b10cb38649244c1cfe8b3a35ce6863244a244c76184d9bc60b738440f27c3ad
7
- data.tar.gz: 350d3330f5dede452d822377b3e94c3173879f7b747c7eca06f6d6d7c9fd46a3a8598da306dac32188b00e89d37592f0e99f1e135ac039f448b8e2db4bd5b530
6
+ metadata.gz: b0f2f4de753002a818d09e09004708747bd80584bb4c1211d236b1ebc31d31425bc44c5d04c8fd1b8b20d5af7e1e601208129b15a34468deb2e98960b57dbea7
7
+ data.tar.gz: 6d663575b3d182fb4ab5ba9c2b9e78be8814445df4c3820d2fc5765a8de3bc2474b56599e9fcd6a24326c591504dca3da01be68c53c78a6e9411a060faee0848
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.10.0 - February 25, 2016
2
+
3
+ - BREAKING CHANGE: Pass an `Ibandit::IBAN` object to modulus checker hooks,
4
+ rather than a string. See https://github.com/gocardless/ibandit/pull/68 for
5
+ more details.
6
+
1
7
  ## 0.9.1 - January 26, 2016
2
8
 
3
9
  - Update BLZ data
data/lib/ibandit/iban.rb CHANGED
@@ -385,21 +385,21 @@ module Ibandit
385
385
  end
386
386
 
387
387
  def valid_modulus_check_bank_code?
388
- return true if Ibandit.modulus_checker.valid_bank_code?(iban.to_s)
388
+ return true if Ibandit.modulus_checker.valid_bank_code?(self)
389
389
 
390
390
  @errors[:bank_code] = Ibandit.translate(:is_invalid)
391
391
  false
392
392
  end
393
393
 
394
394
  def valid_modulus_check_branch_code?
395
- return true if Ibandit.modulus_checker.valid_branch_code?(iban.to_s)
395
+ return true if Ibandit.modulus_checker.valid_branch_code?(self)
396
396
 
397
397
  @errors[:branch_code] = Ibandit.translate(:is_invalid)
398
398
  false
399
399
  end
400
400
 
401
401
  def valid_modulus_check_account_number?
402
- return true if Ibandit.modulus_checker.valid_account_number?(iban.to_s)
402
+ return true if Ibandit.modulus_checker.valid_account_number?(self)
403
403
 
404
404
  @errors[:account_number] = Ibandit.translate(:is_invalid)
405
405
  false
@@ -1,3 +1,3 @@
1
1
  module Ibandit
2
- VERSION = '0.9.1'.freeze
2
+ VERSION = '0.10.0'.freeze
3
3
  end
@@ -1149,7 +1149,16 @@ describe Ibandit::IBAN do
1149
1149
  let(:valid_branch_code) { true }
1150
1150
  let(:valid_account_number) { true }
1151
1151
 
1152
+ it 'calls valid_bank_code? with an IBAN object' do
1153
+ expect(Ibandit.modulus_checker).
1154
+ to receive(:valid_bank_code?).
1155
+ with(instance_of(Ibandit::IBAN))
1156
+
1157
+ iban.valid_local_modulus_check?
1158
+ end
1159
+
1152
1160
  it { is_expected.to be(false) }
1161
+
1153
1162
  context 'locale en', locale: :en do
1154
1163
  specify { expect(iban.errors).to include(bank_code: 'is invalid') }
1155
1164
  end
@@ -1190,7 +1199,16 @@ describe Ibandit::IBAN do
1190
1199
  let(:valid_branch_code) { false }
1191
1200
  let(:valid_account_number) { true }
1192
1201
 
1202
+ it 'calls valid_branch_code? with an IBAN object' do
1203
+ expect(Ibandit.modulus_checker).
1204
+ to receive(:valid_branch_code?).
1205
+ with(instance_of(Ibandit::IBAN))
1206
+
1207
+ iban.valid_local_modulus_check?
1208
+ end
1209
+
1193
1210
  it { is_expected.to be(false) }
1211
+
1194
1212
  context 'locale en', locale: :en do
1195
1213
  specify do
1196
1214
  expect(iban.errors).to include(branch_code: 'is invalid')
@@ -1239,7 +1257,16 @@ describe Ibandit::IBAN do
1239
1257
  let(:valid_branch_code) { true }
1240
1258
  let(:valid_account_number) { false }
1241
1259
 
1260
+ it 'calls valid_account_number? with an IBAN object' do
1261
+ expect(Ibandit.modulus_checker).
1262
+ to receive(:valid_account_number?).
1263
+ with(instance_of(Ibandit::IBAN))
1264
+
1265
+ iban.valid_local_modulus_check?
1266
+ end
1267
+
1242
1268
  it { is_expected.to be(false) }
1269
+
1243
1270
  context 'locale en', locale: :en do
1244
1271
  specify do
1245
1272
  expect(iban.errors).to include(account_number: 'is invalid')
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.9.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grey Baker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-26 00:00:00.000000000 Z
11
+ date: 2016-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec