Skip to content

Commit

Permalink
Tests: Check for error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ledermann committed Apr 15, 2022
1 parent 835d155 commit b84bba6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions spec/credit_transfer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
it 'should fail' do
expect {
SEPA::CreditTransfer.new.to_xml
}.to raise_error(SEPA::Error)
}.to raise_error(SEPA::Error, /Name is too short/)
end
end

Expand Down Expand Up @@ -118,13 +118,13 @@
it 'should fail for pain.001.001.03' do
expect {
subject.to_xml(SEPA::PAIN_001_001_03)
}.to raise_error(SEPA::Error)
}.to raise_error(SEPA::Error, /Incompatible with schema/)
end

it 'should fail for pain.001.002.03' do
expect {
subject.to_xml(SEPA::PAIN_001_002_03)
}.to raise_error(SEPA::Error)
}.to raise_error(SEPA::Error, /Incompatible with schema/)
end
end

Expand Down Expand Up @@ -381,13 +381,13 @@
it 'should fail for pain.001.002.03' do
expect {
subject.to_xml(SEPA::PAIN_001_002_03)
}.to raise_error(SEPA::Error)
}.to raise_error(SEPA::Error, /Incompatible with schema/)
end

it 'should fail for pain.001.003.03' do
expect {
subject.to_xml(SEPA::PAIN_001_003_03)
}.to raise_error(SEPA::Error)
}.to raise_error(SEPA::Error, /Incompatible with schema/)
end
end

Expand All @@ -409,7 +409,7 @@
it 'should fail for pain.001.002.03' do
expect {
subject.to_xml(SEPA::PAIN_001_002_03)
}.to raise_error(SEPA::Error)
}.to raise_error(SEPA::Error, /Incompatible with schema/)
end

it 'should validate against pain.001.003.03' do
Expand Down
12 changes: 6 additions & 6 deletions spec/direct_debit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
it 'should fail' do
expect {
SEPA::DirectDebit.new.to_xml
}.to raise_error(SEPA::Error)
}.to raise_error(SEPA::Error, /Name is too short/)
end
end

Expand Down Expand Up @@ -158,7 +158,7 @@
it 'should fail for pain.008.002.02' do
expect {
subject.to_xml(SEPA::PAIN_008_002_02)
}.to raise_error(SEPA::Error)
}.to raise_error(SEPA::Error, /Incompatible with schema/)
end

it 'should validate against pain.008.001.02' do
Expand Down Expand Up @@ -385,7 +385,7 @@
it 'should raise error on XML generation' do
expect {
subject.to_xml
}.to raise_error(SEPA::Error)
}.to raise_error(SEPA::Error, /CORE, COR1 AND B2B must not be mixed in one message/)
end
end

Expand Down Expand Up @@ -533,7 +533,7 @@
end

it 'should fail as the payment identification becomes too large' do
expect { subject.to_xml }.to raise_error(SEPA::Error)
expect { subject.to_xml }.to raise_error(SEPA::Error, /The value has a length of '37'; this exceeds the allowed maximum length of '35'/)
end
end

Expand Down Expand Up @@ -562,13 +562,13 @@
it 'should fail for pain.008.002.02' do
expect {
subject.to_xml(SEPA::PAIN_008_002_02)
}.to raise_error(SEPA::Error)
}.to raise_error(SEPA::Error, /Incompatible with schema/)
end

it 'should fail for pain.008.003.02' do
expect {
subject.to_xml(SEPA::PAIN_008_003_02)
}.to raise_error(SEPA::Error)
}.to raise_error(SEPA::Error, /Incompatible with schema/)
end
end
end
Expand Down

0 comments on commit b84bba6

Please sign in to comment.