summaryrefslogtreecommitdiffstats
path: root/test/unit/lib/redmine/unified_diff_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-05-05 11:56:05 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-05-05 11:56:05 +0000
commit92fdcc1ce4f0a7d8555a245e8e4d016b67d4d998 (patch)
treeef7c7d49409c5b1250dd1da5921266cfbe73f34f /test/unit/lib/redmine/unified_diff_test.rb
parentff41de6f8e8c6fd6f0d72f2a37953045977542c4 (diff)
downloadredmine-92fdcc1ce4f0a7d8555a245e8e4d016b67d4d998.tar.gz
redmine-92fdcc1ce4f0a7d8555a245e8e4d016b67d4d998.zip
remove git format patch footer (#33357)
git-svn-id: http://svn.redmine.org/redmine/trunk@19752 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/lib/redmine/unified_diff_test.rb')
-rw-r--r--test/unit/lib/redmine/unified_diff_test.rb20
1 files changed, 18 insertions, 2 deletions
diff --git a/test/unit/lib/redmine/unified_diff_test.rb b/test/unit/lib/redmine/unified_diff_test.rb
index bbe976cdb..6977b1e2e 100644
--- a/test/unit/lib/redmine/unified_diff_test.rb
+++ b/test/unit/lib/redmine/unified_diff_test.rb
@@ -449,8 +449,24 @@ class Redmine::UnifiedDiffTest < ActiveSupport::TestCase
assert_equal '-- ', footer_lines[0]
assert_equal '', footer_lines[-1]
diff = Redmine::UnifiedDiff.new(body_lines.join("\n") + "\n", :type => 'sbs')
- assert_equal 1, diff.size
- assert_equal 5, diff[0].size
+
+ diff_size = diff.size
+ diff_0_size = diff[0].size
+ assert_equal 1, diff_size
+ assert_equal 5, diff_0_size
+
+ diff = Redmine::UnifiedDiff.new("test\n", :type => 'sbs')
+ assert_equal 0, diff.size
+ diff = Redmine::UnifiedDiff.new("test\ntest\n", :type => 'sbs')
+ assert_equal 0, diff.size
+
+ diff = Redmine::UnifiedDiff.new(raw, :type => 'sbs')
+ assert_equal diff_size, diff.size
+ assert_equal diff_0_size, diff[0].size
+
+ diff = Redmine::UnifiedDiff.new(raw + "\n\n\n\n", :type => 'sbs')
+ assert_equal diff_size, diff.size
+ assert_equal diff_0_size, diff[0].size
end
private