Skip to content

Commit

Permalink
tests: add support for Minitest versions < 5
Browse files Browse the repository at this point in the history
Minitest versions 4 and below do not support the newer Minitest::Test
class that arrived in version 5. Use MiniTest::Unit::TestCase as a
fallback.
  • Loading branch information
ktdreyer committed Apr 4, 2014
1 parent 8d183d8 commit 45a5dd5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
require 'stringio'
require 'minitest/autorun'
require File.dirname(__FILE__) + '/../lib/geoip'

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

0 comments on commit 45a5dd5

Please sign in to comment.