Skip to content

Commit 577799a

Browse files
committed
[test] back to fiddling with runit boot - test/unit is back!
1 parent 2ca8359 commit 577799a

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/test/ruby/test_helper.rb

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
raise "bcpkix jar not found" unless jar; $CLASSPATH << jar
2222
end if defined? JRUBY_VERSION
2323

24-
# NOTE: RUnit maven plugin (<= 1.0.5) does not handle test-unit well !
25-
#begin
26-
# gem 'test-unit'
27-
#rescue LoadError
28-
# puts "gem 'test-unit' not available, will load built-in 'test/unit'"
29-
#end
24+
begin
25+
gem 'test-unit'
26+
rescue LoadError
27+
warn "gem 'test-unit' not available, will load built-in 'test/unit'"
28+
end
29+
3030
begin
3131
gem 'minitest'
3232
require 'minitest/autorun'
@@ -51,8 +51,10 @@ def self.plugin_output_init(options)
5151
end
5252
end
5353
end
54-
rescue LoadError
55-
end
54+
rescue LoadError => e
55+
warn "gem 'minitest' failed to load: #{e.inspect}"
56+
end unless (Test::Unit::AutoRunner.respond_to?(:setup_option)) rescue true # runit rules
57+
# @see https://github.com/torquebox/jruby-maven-plugins/blob/master/runit-maven-plugin/src/main/java/de/saumya/mojo/runit/RunitMavenTestScriptFactory.java
5658

5759
if defined? Minitest::Test
5860
TestCase = Minitest::Test
@@ -61,6 +63,8 @@ def self.plugin_output_init(options)
6163
TestCase = Test::Unit::TestCase
6264
end
6365

66+
puts "#{__FILE__} using #{TestCase}" if $VERBOSE || defined?(REPORT_PATH)
67+
6468
TestCase.class_eval do
6569

6670
def setup; require 'openssl' end

0 commit comments

Comments
 (0)