Skip to content

Commit d9e209f

Browse files
authored
Lint: Fix Style/BlockDelimiters cop (#765)
1 parent 2f4283c commit d9e209f

File tree

4 files changed

+14
-26
lines changed

4 files changed

+14
-26
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/active_record/monetizable_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ def assert_monetized_attributes(monetized_attributes, expected_attributes)
212212
end
213213

214214
it "raises an exception if it can't change currency" do
215-
expect {
215+
expect do
216216
Product.new.price = Money.new(10, "RUB")
217-
}.to raise_error(
217+
end.to raise_error(
218218
MoneyRails::ActiveRecord::Monetizable::ReadOnlyCurrencyException,
219219
"Can't change readonly currency 'USD' to 'RUB' for field 'price'",
220220
)
@@ -1039,16 +1039,16 @@ def assert_monetized_attributes(monetized_attributes, expected_attributes)
10391039
after { MoneyRails.raise_error_on_money_parsing = false }
10401040

10411041
it "raises a MoneyRails::Error when given an invalid value" do
1042-
expect {
1042+
expect do
10431043
product.write_monetized :price, :price_cents, "10-50", false, nil, {}
1044-
}.to raise_error(MoneyRails::Error)
1044+
end.to raise_error(MoneyRails::Error)
10451045
end
10461046

10471047
it "raises a MoneyRails::Error error when trying to set invalid currency" do
10481048
allow(product).to receive(:currency_for_price).and_return("INVALID_CURRENCY")
1049-
expect {
1049+
expect do
10501050
product.write_monetized :price, :price_cents, 10, false, nil, {}
1051-
}.to raise_error(MoneyRails::Error)
1051+
end.to raise_error(MoneyRails::Error)
10521052
end
10531053
end
10541054

spec/configuration_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@
105105
it "accepts default currency which doesn't have minor unit" do
106106
old_currency = MoneyRails.default_currency
107107

108-
expect {
108+
expect do
109109
MoneyRails.default_currency = :jpy
110-
}.to_not raise_error
110+
end.to_not raise_error
111111

112112
expect(MoneyRails.amount_column[:postfix]).to eq("_cents")
113113

spec/mongoid/mongoid_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@
1010
let(:priceable_from_num) { Priceable.create(price: 1) }
1111
let(:priceable_from_string) { Priceable.create(price: "1 EUR") }
1212
let(:priceable_from_hash) { Priceable.create(price: { cents: 100, currency_iso: "EUR" }) }
13-
let(:priceable_from_blank_strings_hash) {
13+
let(:priceable_from_blank_strings_hash) do
1414
Priceable.create(price: { cents: "", currency_iso: "" })
15-
}
16-
let(:priceable_from_hash_with_indifferent_access) {
15+
end
16+
let(:priceable_from_hash_with_indifferent_access) do
1717
Priceable.create(price: { cents: 100, currency_iso: "EUR" }.with_indifferent_access)
18-
}
18+
end
1919
let(:priceable_from_string_with_hyphen) { Priceable.create(price: "1-2 EUR") }
2020
let(:priceable_from_string_with_unknown_currency) { Priceable.create(price: "1 TLDR") }
2121
let(:priceable_with_infinite_precision) { Priceable.create(price: Money.new(BigDecimal("100.1"), "EUR")) }
22-
let(:priceable_with_hash_field) {
22+
let(:priceable_with_hash_field) do
2323
Priceable.create(price_hash: {
2424
key1: Money.new(100, "EUR"),
2525
key2: Money.new(200, "USD"),
2626
})
27-
}
27+
end
2828

2929
context "when mongoizing" do
3030
it "correctly mongoizes nil to nil" do

0 commit comments

Comments
 (0)