]> source.dussan.org Git - redmine.git/commitdiff
scm: mercurial: remove new line in diff unit test(#7253).
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sun, 9 Jan 2011 14:19:39 +0000 (14:19 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sun, 9 Jan 2011 14:19:39 +0000 (14:19 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4669 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb

index 2285d92b6c1e2e78cdb8537fbf12fe0e89464b99..d7b9c882f77c0503cafd92cf274484ee4484a823 100644 (file)
@@ -48,14 +48,17 @@ begin
         [2, '400bb8672109', '400', 400].each do |r1|
           diff1 = @adapter.diff(nil, r1)
           assert_equal 28, diff1.size
-          assert_equal "+    return true unless klass.respond_to?('watched_by')\r\n", diff1[24]
+          buf = diff1[24].gsub(/\r\n|\r|\n/, "")
+          assert_equal "+    return true unless klass.respond_to?('watched_by')", buf
           [4, 'def6d2f1254a'].each do |r2|
             diff2 = @adapter.diff(nil,r1,r2)
             assert_equal 50, diff2.size
-            assert_equal "+class WelcomeController < ApplicationController\r\n", diff2[42]
+            buf =  diff2[42].gsub(/\r\n|\r|\n/, "")
+            assert_equal "+class WelcomeController < ApplicationController", buf
             diff3 = @adapter.diff('sources/watchers_controller.rb', r1, r2)
             assert_equal 20, diff3.size
-            assert_equal "+    @watched.remove_watcher(user)\r\n", diff3[12]
+            buf =  diff3[12].gsub(/\r\n|\r|\n/, "")
+            assert_equal "+    @watched.remove_watcher(user)", buf
           end
         end
       end