1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
From dc6b1c55a14349ddc310242103f7f0710e6f1c73 Mon Sep 17 00:00:00 2001
From: Ken Dreyer <ktdreyer@ktdreyer.com>
Date: Tue, 8 Apr 2014 11:07:20 -0500
Subject: [PATCH] Fedora: tests: switch to minitest
Ruby 1.9+ uses Minitest as the backend for Test::Unit. As of Minitest 5,
the shim no longer supports Test::Unit::TestCase.
Adjust the svn2git test suite to support Minitest 5's syntax.
Minitest versions 4 and below do not support the newer Minitest::Test
class that arrived in version 5. For that case, use the
MiniTest::Unit::TestCase class as a fallback.
This patch has been adjusted from the canonical submission upstream
https://github.com/nirvdrum/svn2git/pull/160 because we do not need or
want the gemspec change for Fedora. For Fedora's builds, we regenerate
the gemspec file dynamically, so a static gemspec patch is not
desirable.
---
test/escape_quotes_test.rb | 2 +-
test/test_helper.rb | 9 ++++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/test/escape_quotes_test.rb b/test/escape_quotes_test.rb
index 56fe070..3f5150c 100644
--- a/test/escape_quotes_test.rb
+++ b/test/escape_quotes_test.rb
@@ -1,6 +1,6 @@
require File.expand_path(File.join(__FILE__, '..', 'test_helper'))
-class EscapeQuotesTest < Test::Unit::TestCase
+class EscapeQuotesTest < Minitest::Test
def test_identity
expected = 'A string without any need to escape.'
actual = Svn2Git::Migration.escape_quotes(expected)
diff --git a/test/test_helper.rb b/test/test_helper.rb
index eac834b..9ae7650 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -1,4 +1,11 @@
$:.unshift "#{File.dirname(__FILE__)}/../lib"
require 'svn2git'
-require 'test/unit'
\ No newline at end of file
+require 'minitest/autorun'
+
+if Minitest.const_defined?('Test')
+ # We're on Minitest 5+. Nothing to do here.
+else
+ # Minitest 4 doesn't have Minitest::Test yet.
+ Minitest::Test = MiniTest::Unit::TestCase
+end
\ No newline at end of file
--
1.8.5.3
|