From 7fcf6d64b0b5acf86d70eebf686641385223c591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Thu, 14 Nov 2013 14:54:40 +0100 Subject: [PATCH] Switch to minitest for consistent output between Ruby versions In Ruby 2.0, `test/unit` activates a fancy output style for terminals that doesn't look well in Travis logs. I could disable it with the `--jobs-status=normal` test optiont, but that option isn't supported in Ruby 1.8.7. Instead of dealing with inconsistencies between test support in different Ruby versions, I'm simply switching to a fixed version of Minitest. --- Gemfile | 1 + Gemfile.lock | 2 ++ Rakefile | 2 -- test/context_test.rb | 2 +- test/helper.rb | 4 ++-- test/hub_test.rb | 4 ++-- test/standalone_test.rb | 2 +- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index 75858413..8c27af1e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,6 @@ source 'https://rubygems.org' +gem 'minitest' gem 'ronn', :platform => :mri gem 'aruba', '~> 0.5.3' gem 'cucumber', '~> 1.2.1' diff --git a/Gemfile.lock b/Gemfile.lock index 3f4ecc29..bb7d2953 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -33,6 +33,7 @@ GEM bouncy-castle-java (>= 1.5.0146.1) json (1.8.0) json (1.8.0-java) + minitest (5.0.5) multi_json (1.7.7) mustache (0.99.4) rack (1.4.1) @@ -65,6 +66,7 @@ DEPENDENCIES hub! jruby-openssl json + minitest rake ronn sinatra diff --git a/Rakefile b/Rakefile index 04d32e98..ff382e87 100644 --- a/Rakefile +++ b/Rakefile @@ -31,9 +31,7 @@ task :default => [:test, :features] Rake::TestTask.new do |t| t.libs << 'test' - t.ruby_opts << '-rubygems' t.pattern = 'test/**/*_test.rb' - t.verbose = false end task :features do diff --git a/test/context_test.rb b/test/context_test.rb index ac2b6238..c076e30a 100644 --- a/test/context_test.rb +++ b/test/context_test.rb @@ -1,6 +1,6 @@ require 'helper' -class ContextTest < Test::Unit::TestCase +class ContextTest < Minitest::Test class Context include Hub::Context diff --git a/test/helper.rb b/test/helper.rb index 08b4a9f5..9a2a2582 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,4 +1,4 @@ -require 'test/unit' +require 'minitest/autorun' require 'hub' # We're checking for `open` in our tests @@ -28,7 +28,7 @@ Hub::Commands.extend Module.new { end } -class Test::Unit::TestCase +class Minitest::Test # Shortcut for creating a `Hub` instance. Pass it what you would # normally pass `hub` on the command line, e.g. # diff --git a/test/hub_test.rb b/test/hub_test.rb index 5c960842..3bd710c0 100644 --- a/test/hub_test.rb +++ b/test/hub_test.rb @@ -1,5 +1,5 @@ require 'helper' -require 'webmock/test_unit' +require 'webmock/minitest' require 'rbconfig' require 'yaml' require 'forwardable' @@ -19,7 +19,7 @@ WebMock::BodyPattern.class_eval do end end -class HubTest < Test::Unit::TestCase +class HubTest < Minitest::Test extend Forwardable if defined? WebMock::API diff --git a/test/standalone_test.rb b/test/standalone_test.rb index 548572aa..d95bdd1a 100644 --- a/test/standalone_test.rb +++ b/test/standalone_test.rb @@ -3,7 +3,7 @@ require 'hub/standalone' require 'fileutils' require 'stringio' -class StandaloneTest < Test::Unit::TestCase +class StandaloneTest < Minitest::Test include FileUtils def setup -- GitLab