diff options
author | Robin Dupret <robin.dupret@gmail.com> | 2013-12-27 11:30:53 +0100 |
---|---|---|
committer | Robin Dupret <robin.dupret@gmail.com> | 2013-12-27 11:30:53 +0100 |
commit | a9444916ee63a9c5f113a7d4a7e9d6eeb39387b6 (patch) | |
tree | 7d927a935491370d36b5490cc8b64827fa5f89f6 /guides/bug_report_templates/active_record_gem.rb | |
parent | 864514a460d8fdcd8766ca5a9bba2978038985aa (diff) | |
download | rails-a9444916ee63a9c5f113a7d4a7e9d6eeb39387b6.tar.gz rails-a9444916ee63a9c5f113a7d4a7e9d6eeb39387b6.tar.bz2 rails-a9444916ee63a9c5f113a7d4a7e9d6eeb39387b6.zip |
Ensure backward compatibility between Minitest 5 and 4
Define Minitest::Test in case we are running the gist under Minitest 4
and avoid relying on MiniTest::Unit::TestCase to avoid displaying
warning on version five.
[ci skip]
Diffstat (limited to 'guides/bug_report_templates/active_record_gem.rb')
-rw-r--r-- | guides/bug_report_templates/active_record_gem.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/guides/bug_report_templates/active_record_gem.rb b/guides/bug_report_templates/active_record_gem.rb index 63fbe27aed..d72633d0b2 100644 --- a/guides/bug_report_templates/active_record_gem.rb +++ b/guides/bug_report_templates/active_record_gem.rb @@ -4,6 +4,9 @@ require 'active_record' require 'minitest/autorun' require 'logger' +# Ensure backward compatibility with Minitest 4 +Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test) + # This connection will do for database-independent bug reports. ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') ActiveRecord::Base.logger = Logger.new(STDOUT) |