Skip to content

Commit

Permalink
Fix Rubocop issues
Browse files Browse the repository at this point in the history
  • Loading branch information
timriley committed Apr 28, 2024
1 parent 4919b28 commit d8165a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 2 additions & 3 deletions spec/support/fixtures.rb
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ class IterateCookiesAction < Hanami::Action

def handle(*, res)
result = []
res.cookies.each do |key, value|
res.cookies.each do |key, value| # rubocop:disable Style/MapIntoArray
result << "'#{key}' has value '#{value}'"
end

Expand Down Expand Up @@ -1781,8 +1781,7 @@ class Each < Hanami::Action
include Hanami::Action::Session

def handle(_, res)
each_result = []
res.flash.each { |type, message| each_result << [type, message] }
each_result = res.flash.map { |type, message| [type, message] }
res.body = "flash_each: #{each_result}"
end
end
Expand Down
2 changes: 2 additions & 0 deletions spec/unit/hanami/action/flash_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
end
end

# rubocop:disable Style/MapIntoArray
describe "#each" do
let(:input_hash) { {a: "val"} }

Expand All @@ -71,6 +72,7 @@
expect(accumulator).to eq(input_hash.to_a)
end
end
# rubocop:enable Style/MapIntoArray

describe "#map" do
let(:input_hash) { {a: "val"} }
Expand Down

0 comments on commit d8165a1

Please sign in to comment.