]> source.dussan.org Git - redmine.git/commitdiff
replace white spaces of here-text at RepositoryTest#test_for_changeset_comments_strip
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 10 Jul 2017 04:47:56 +0000 (04:47 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 10 Jul 2017 04:47:56 +0000 (04:47 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@16809 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/repository_test.rb

index 859b5ca438fe389ce8d058a634f535252b53adfd..cbcf8a0e9f3a0606f69d26528c0278f229c76f1d 100644 (file)
@@ -279,20 +279,18 @@ class RepositoryTest < ActiveSupport::TestCase
     repository = Repository::Mercurial.create(
                     :project => Project.find( 4 ),
                     :url => '/foo/bar/baz' )
-    comment = <<-COMMENT
-    This is a loooooooooooooooooooooooooooong comment                                                   
-                                                                                                       
-                                                                                            
-    COMMENT
+    long_whitespace = "                                                "
+    expected_comment = "This is a loooooooooooooooooooooooooooong comment"
+    comment = "#{expected_comment}#{long_whitespace}\n"
+    3.times {comment << "#{long_whitespace}\n"}
     changeset = Changeset.new(
       :comments => comment, :commit_date => Time.now,
       :revision => 0, :scmid => 'f39b7922fb3c',
       :committer => 'foo <foo@example.com>',
       :committed_on => Time.now, :repository => repository )
     assert( changeset.save )
-    assert_not_equal( comment, changeset.comments )
-    assert_equal( 'This is a loooooooooooooooooooooooooooong comment',
-                  changeset.comments )
+    assert_not_equal comment, changeset.comments
+    assert_equal     expected_comment, changeset.comments
   end
 
   def test_for_urls_strip_cvs