From f7f40139ddde0dc80933354ff1064af1acc09b63 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Tue, 9 Apr 2024 09:49:17 +0000 Subject: [PATCH] Fix RuboCop offense Style/MapIntoArray (#39887). git-svn-id: https://svn.redmine.org/redmine/trunk@22778 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/lib/redmine/scm/adapters/git_adapter_test.rb | 5 +---- test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb index 6ea41e75e..49e9e1de2 100644 --- a/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb +++ b/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb @@ -75,10 +75,7 @@ class GitAdapterTest < ActiveSupport::TestCase end def test_branches - brs = [] - @adapter.branches.each do |b| - brs << b - end + brs = @adapter.branches assert_equal 8, brs.length br_issue_8857 = brs[0] assert_equal 'issue-8857', br_issue_8857.to_s diff --git a/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb index d8347c6dd..b4f284103 100644 --- a/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb +++ b/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb @@ -353,10 +353,7 @@ class MercurialAdapterTest < ActiveSupport::TestCase end def test_branches - branches = [] - @adapter.branches.each do |b| - branches << b - end + branches = @adapter.branches assert_equal 10, branches.length branch = branches[-10] -- 2.39.5