Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions .rubocop_todo.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion spec/bank/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

describe "#initialize" do
it "accepts a block and stores @rounding_method" do
proc = Proc.new { |n| n.ceil }
proc = proc(&:ceil)
bank = described_class.new(&proc)
expect(bank.rounding_method).to eq proc
end
Expand Down
6 changes: 3 additions & 3 deletions spec/bank/variable_exchange_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
# end

it "accepts a custom truncation method" do
proc = Proc.new { |n| n.ceil }
proc = proc(&:ceil)
expect(bank.exchange_with(Money.new(10, 'USD'), 'EUR', &proc)).to eq Money.new(14, 'EUR')
end

Expand All @@ -89,7 +89,7 @@

context "with &block" do
let(:bank) do
proc = Proc.new { |n| n.ceil }
proc = proc(&:ceil)
described_class.new(&proc).tap do |bank|
bank.add_rate('USD', 'EUR', 1.33)
end
Expand All @@ -101,7 +101,7 @@
end

it "accepts a custom truncation method" do
proc = Proc.new { |n| n.ceil + 1 }
proc = proc { |n| n.ceil + 1 }
expect(bank.exchange_with(Money.new(10, 'USD'), 'EUR', &proc)).to eq Money.new(15, 'EUR')
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/currency_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def to_s

it "doesn't create new symbols indefinitely" do
expect { described_class.new("bogus") }.to raise_error(described_class::UnknownCurrency)
expect(Symbol.all_symbols.map { |s| s.to_s }).not_to include("bogus")
expect(Symbol.all_symbols.map(&:to_s)).not_to include("bogus")
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/money/formatting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
end

it "respects the thousands_separator and decimal_mark defaults" do
one_thousand = Proc.new do |currency|
one_thousand = proc do |currency|
Money.new(1000_00, currency).format
end

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

specify "(symbol: true) returns symbol based on the given currency code" do
one = Proc.new do |currency|
one = proc do |currency|
Money.new(100, currency).format(symbol: true)
end

Expand Down
4 changes: 2 additions & 2 deletions spec/money_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@
end

it "accepts a lambda" do
Money.default_currency = lambda { :eur }
Money.default_currency = -> { :eur }
expect(Money.default_currency).to eq Money::Currency.new(:eur)
end

Expand All @@ -1132,7 +1132,7 @@
end

it 'accepts a lambda' do
Money.default_bank = lambda { Money::Bank::SingleCurrency.instance }
Money.default_bank = -> { Money::Bank::SingleCurrency.instance }
expect(Money.default_bank).to be_instance_of(Money::Bank::SingleCurrency)
end
end
Expand Down