File: maxitest_plugin.rb

package info (click to toggle)
ruby-maxitest 5.8.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 536 kB
  • sloc: ruby: 1,578; makefile: 7
file content (26 lines) | stat: -rw-r--r-- 973 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# we are not enabling our extensions unless maxitest/autorun was loaded
# minitest plugin system auto-loads all files in the load path and that would
# always enable all our plugins even if they were not wanted
if defined?(Maxitest::ENABLE_PLUGINS) && Maxitest::ENABLE_PLUGINS
  disabled_for_rails = begin
    require 'rails/version'
    Rails::VERSION::MAJOR >= 5
  rescue LoadError
    false
  end

  # rails has --backtrace which disables rails own backtrace cleaner, but not minitests
  require "maxitest/verbose_backtrace"

  unless disabled_for_rails # rails 5 adds default red/green output
    require "maxitest/vendor/rg"
    Minitest.extensions << "rg"
    Minitest::RG.rg! $stdout.tty?
  end

  # rails 5.2+ has it's own line support
  # - it breaks `mtest file:line` format
  # - we still want our format with the nice summary at the end, even if the `bin/rails test` output is already inline
  require "maxitest/vendor/line"
  Minitest.extensions << "line"
end