Sha256: 4771fbbb745bcd1430ce5437fc1abca02a6d56e1c79807bef7354cb1333fb0b2
Contents?: true
Size: 1.49 KB
Versions: 1
Compression:
Stored size: 1.49 KB
Contents
require 'spec_helper' module BicValidation describe Bic do context 'basic methods 11 digit' do before { @bic = Bic.new 'MARKDEF1850' } subject { @bic } describe '#valid?' do it { should be_valid } end describe '#known?' do it { should be_known } end describe '#bank' do its(:bank) { should eq('MARK') } end describe '#country' do its(:country) { should eq('DE') } end describe '#location' do its(:location) { should eq('F1') } end describe '#branch' do its(:branch) { should eq('850') } end end context 'basic methods 8 digit' do before { @bic = Bic.new 'DEUTDEBB' } subject { @bic } describe '#valid?' do it { should be_valid } end describe '#known?' do it { should be_known } end describe '#bank' do its(:bank) { should eq('DEUT') } end describe '#country' do its(:country) { should eq('DE') } end describe '#location' do its(:location) { should eq('BB') } end describe '#branch' do its(:branch) { should be_nil } end end ['DEUTDEBB', 'CRESCHZZ10S', 'UBSWCHZH86N', 'OEKOATWWXXX', 'OEKOATWW'].each do |swift| describe 'validity checks' do it "validates #{swift}" do bic = Bic.new(swift) expect(bic).to be_valid expect(bic).to be_known end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
bic_validation-0.1.0 | spec/bic_validation/bic_spec.rb |