]> source.dussan.org Git - redmine.git/commitdiff
Fix RuboCop offense Style/MapIntoArray (#39887).
authorGo MAEDA <maeda@farend.jp>
Tue, 9 Apr 2024 09:49:17 +0000 (09:49 +0000)
committerGo MAEDA <maeda@farend.jp>
Tue, 9 Apr 2024 09:49:17 +0000 (09:49 +0000)
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
test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb

index 6ea41e75e22e74e949c2c3a714cc3bac399d0b08..49e9e1de205f1da7ca70303978d36aff9b503674 100644 (file)
@@ -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
index d8347c6dda3e564ba3b5f364b8186461db0f8a0e..b4f28410330a3eaa7e8f6dba5413f422c43e5e37 100644 (file)
@@ -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]