From f3a069281ec9387d3729804af3d1674bda11016f Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Mon, 9 May 2011 15:26:50 +0000 Subject: [PATCH] scm: git: fix incorrect comment in unit model test and code clean up unit model test. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5722 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/repository_git_test.rb | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/test/unit/repository_git_test.rb b/test/unit/repository_git_test.rb index 198fb319e..e1e3cbe34 100644 --- a/test/unit/repository_git_test.rb +++ b/test/unit/repository_git_test.rb @@ -78,13 +78,19 @@ class RepositoryGitTest < ActiveSupport::TestCase def test_fetch_changesets_incremental @repository.fetch_changesets - # Remove the 3 latest changesets - @repository.changesets.find(:all, :order => 'committed_on DESC', :limit => 8).each(&:destroy) + + # Remove the latest changesets + @repository.changesets.find( + :all, + :order => 'committed_on DESC', + :limit => 8).each(&:destroy) @repository.reload cs1 = @repository.changesets assert_equal 13, cs1.count - rev_a_commit = @repository.changesets.find(:first, :order => 'committed_on DESC') + rev_a_commit = @repository.changesets.find( + :first, + :order => 'committed_on DESC') assert_equal '4f26664364207fa8b1af9f8722647ab2d4ac5d43', rev_a_commit.revision # Mon Jul 5 22:34:26 2010 +0200 rev_a_committed_on = Time.gm(2010, 7, 5, 20, 34, 26) @@ -243,14 +249,16 @@ class RepositoryGitTest < ActiveSupport::TestCase def test_identifier @repository.fetch_changesets @repository.reload - c = @repository.changesets.find_by_revision('7234cb2750b63f47bff735edc50a1c0a433c2518') + c = @repository.changesets.find_by_revision( + '7234cb2750b63f47bff735edc50a1c0a433c2518') assert_equal c.scmid, c.identifier end def test_format_identifier @repository.fetch_changesets @repository.reload - c = @repository.changesets.find_by_revision('7234cb2750b63f47bff735edc50a1c0a433c2518') + c = @repository.changesets.find_by_revision( + '7234cb2750b63f47bff735edc50a1c0a433c2518') assert_equal '7234cb27', c.format_identifier end @@ -271,7 +279,8 @@ class RepositoryGitTest < ActiveSupport::TestCase if str_felix_hex.respond_to?(:force_encoding) str_felix_hex.force_encoding('UTF-8') end - c = @repository.changesets.find_by_revision('ed5bb786bbda2dee66a2d50faf51429dbc043a7b') + c = @repository.changesets.find_by_revision( + 'ed5bb786bbda2dee66a2d50faf51429dbc043a7b') assert_equal "#{str_felix_hex} ", c.committer end