Skip to content

Commit

Permalink
Fix implicit block expectation syntax warning
Browse files Browse the repository at this point in the history
Close #1076
  • Loading branch information
tagliala committed Mar 4, 2024
1 parent f1b0ee5 commit 2d99767
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions spec/money/arithmetic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,6 @@

%w(+ - / divmod remainder).each do |op|
describe "##{op}" do
subject { ->(other = self.other) { instance.send(op, other) } }
let(:instance) { Money.usd(1) }

context 'when conversions disallowed' do
Expand All @@ -771,12 +770,18 @@

context 'and other is money with different currency' do
let(:other) { Money.gbp(1) }
it { should raise_error Money::Bank::DifferentCurrencyError }

it 'raises Money::Bank::DifferentCurrencyError' do
expect { instance.send(op, other) }.to raise_error Money::Bank::DifferentCurrencyError
end

context 'even for zero' do
let(:instance) { Money.usd(0) }
let(:other) { Money.gbp(0) }
it { should raise_error Money::Bank::DifferentCurrencyError }

it 'raises Money::Bank::DifferentCurrencyError' do
expect { instance.send(op, other) }.to raise_error Money::Bank::DifferentCurrencyError
end
end
end
end
Expand Down

0 comments on commit 2d99767

Please sign in to comment.