Skip to content

Commit

Permalink
Support using an older Minitest gem on Ruby 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cupakromer committed Dec 30, 2014
1 parent ac419d6 commit 999ebb7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/rspec/rails/adapters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ module Rails
# Constant aliased to either Minitest or TestUnit, depending on what is
# loaded.
Assertions = Minitest::Assertions
elsif RUBY_VERSION >= '2.2.0'
# Minitest has been removed from ruby core. However, we must be on an
# old Rails version and must load the Minitest 4.x gem
gem 'minitest' if defined?(Kernel.gem)
require 'minitest/unit'
Assertions = MiniTest::Assertions
else
begin
require 'test/unit/assertions'
Expand Down

0 comments on commit 999ebb7

Please sign in to comment.