]> source.dussan.org Git - redmine.git/commitdiff
code cleanup: rubocop: fix Style/UnneededSort in test/unit/repository_git_test.rb
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 22 Oct 2019 11:31:05 +0000 (11:31 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 22 Oct 2019 11:31:05 +0000 (11:31 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@18797 e93f8b46-1217-0410-a6f0-8f06a7374b81

.rubocop_todo.yml
test/unit/repository_git_test.rb

index 89f874f5af7f1e837b0d1d0932261bfbd31ca921..8018e34cd5deb9b263aa298e59d83ff40678e59b 100644 (file)
@@ -1421,7 +1421,6 @@ Style/UnneededSort:
     - 'lib/redmine/scm/adapters/abstract_adapter.rb'
     - 'test/functional/issues_controller_test.rb'
     - 'test/unit/member_test.rb'
-    - 'test/unit/repository_git_test.rb'
 
 # Cop supports --auto-correct.
 Style/VariableInterpolation:
index 05c94b51c698a51b4fdaf748aa5566e65e02c526..0f5382a410ed706843c871afeab6bdff79375535 100644 (file)
@@ -138,7 +138,7 @@ class RepositoryGitTest < ActiveSupport::TestCase
       assert_equal Time.gm(2007, 12, 14, 9, 22, 52), commit.committed_on
       assert_equal "2007-12-14".to_date, commit.commit_date
       assert_equal 3, commit.filechanges.count
-      change = commit.filechanges.sort_by(&:path).first
+      change = commit.filechanges.min_by(&:path)
       assert_equal "README", change.path
       assert_nil change.from_path
       assert_equal "A", change.action