class method self.plugin_rails_options

Ruby on Rails 8.0.4

Since v5.2.8.1

Available in: v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

self.plugin_rails_options(opts, options)

No documentation comment.

Parameters

opts req
options req
Source
# File railties/lib/minitest/rails_plugin.rb, line 68
  def self.plugin_rails_options(opts, options)
    ::Rails::TestUnit::Runner.attach_before_load_options(opts)

    opts.on("-b", "--backtrace", "Show the complete backtrace") do
      options[:full_backtrace] = true
    end

    opts.on("-d", "--defer-output", "Output test failures and errors after the test run") do
      options[:output_inline] = false
    end

    opts.on("-f", "--fail-fast", "Abort test run on first failure or error") do
      options[:fail_fast] = true
    end

    opts.on("-c", "--[no-]color", "Enable color in the output") do |value|
      options[:color] = value
    end

    opts.on("--profile [COUNT]", "Enable profiling of tests and list the slowest test cases (default: 10)") do |value|
      default_count = 10

      if value.nil?
        count = default_count
      else
        count = Integer(value, exception: false)
        if count.nil?
          warn("Non integer specified as profile count, separate " \
               "your path from options with -- e.g. " \
               "`#{::Rails::TestUnitReporter.executable} --profile -- #{value}`")
          count = default_count
        end
      end

      options[:profile] = count
    end

    options[:color] = true
    options[:output_inline] = true
  end

Defined in railties/lib/minitest/rails_plugin.rb line 68 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Minitest

Type at least 2 characters to search.

↑↓ navigate · open · esc close