Skip to content

Commit 14ba8da

Browse files
committed
Fix blocks style
1 parent a67a176 commit 14ba8da

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ Metrics/MethodLength:
3232
Metrics/PerceivedComplexity:
3333
Max: 15
3434

35-
# Offense count: 2
36-
# Cop supports --auto-correct.
37-
Style/Blocks:
38-
Enabled: false
39-
4035
# Offense count: 31
4136
Style/Documentation:
4237
Enabled: false

spec/grape_entity/entity_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -798,9 +798,9 @@ class Parent < Person
798798
end
799799

800800
it 'does not expose attributes that are generated by a block but have not passed criteria' do
801-
fresh_class.expose :nonexistent_attribute, proc: lambda { |_model, _opts|
802-
'I exist, but it is not yet my time to shine'
803-
}, if: lambda { |_model, _opts| false }
801+
fresh_class.expose :nonexistent_attribute,
802+
proc: lambda { |_model, _opts| 'I exist, but it is not yet my time to shine' },
803+
if: lambda { |_model, _opts| false }
804804
res = fresh_class.new(model).serializable_hash
805805
expect(res).not_to have_key :nonexistent_attribute
806806
end
@@ -820,9 +820,9 @@ class TestEntity < Grape::Entity
820820
end
821821

822822
it 'does not expose attributes that are generated by a block but have not passed criteria' do
823-
fresh_class.expose :nonexistent_attribute, proc: lambda { |_, _|
824-
'I exist, but it is not yet my time to shine'
825-
}, if: lambda { |_, _| false }
823+
fresh_class.expose :nonexistent_attribute,
824+
proc: lambda { |_, _| 'I exist, but it is not yet my time to shine' },
825+
if: lambda { |_, _| false }
826826
res = fresh_class.new(model).serializable_hash
827827
expect(res).not_to have_key :nonexistent_attribute
828828
end

0 commit comments

Comments
 (0)