test/test_helper.rb in m-1.3.4 vs test/test_helper.rb in m-1.4.0

- old
+ new

@@ -1,7 +1,11 @@ -require 'coveralls' -Coveralls.wear_merged! +begin + require 'coveralls' + Coveralls.wear_merged! +rescue LoadError + warn "gem 'coveralls' not available, proceeding without it" +end module Testable def m(arguments) Dir.chdir("test") do `ruby -I../lib -I. ../bin/m #{arguments} 2>&1`.strip @@ -13,13 +17,28 @@ assert_match regexp, output end end require 'm' -require 'minitest/autorun' + +def try_loading(gem) + begin + require gem + rescue LoadError + return false + end +end + +try_loading('test-unit') || +try_loading('minitest/autorun') || +try_loading('test/unit') + if M::Frameworks.test_unit? - require 'test/unit' - require 'active_support/test_case' + begin + require 'test-unit' + rescue LoadError + require('active_support/test_case') + end class MTest < Test::Unit::TestCase include ::Testable end elsif M::Frameworks.minitest5?