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 4aae667
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 4 additions & 6 deletions spec/support/fixtures.rb
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,9 @@ class IterateCookiesAction < Hanami::Action
include Hanami::Action::Cookies

def handle(*, res)
result = []
res.cookies.each do |key, value|
result << "'#{key}' has value '#{value}'"
end
result = res.cookies.map { |key, value|
"'#{key}' has value '#{value}'"
}

res.body = result.join(", ")
end
Expand Down Expand Up @@ -1781,8 +1780,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 4aae667

Please sign in to comment.