1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

4 commits

Author SHA1 Message Date
Jonathan Hefner
33fdae0584 Fix backtraces for generated plugin tests
`Minitest.plugin_rails_init` sets `Minitest.backtrace_filter` to
`Rails.backtrace_cleaner` right before tests are run, overwriting the
value set in test_helper.rb.

`Rails.backtrace_cleaner` silences backtrace lines that do not start
with `Rails.root` followed by e.g. "lib/" or "test/".  Thus when
`Rails.root` is a subdirectory of the project directory -- for example,
when testing a plugin that has a dummy app -- all lines of the backtrace
are silenced.

This commit adds a fallback such that when all backtrace lines are
silenced, the original `Minitest.backtrace_filter` is used instead.

Additionally, this commit refactors and expands existing test coverage.
2020-10-07 15:40:56 -05:00
Dixit Patel
f0af84df47 rubocop single space after assignment 2018-02-19 11:23:47 +05:30
Kasper Timm Hansen
6cc000c34c
Clean up reporter replacement a bit.
* Don't use :: for class methods, we don't do that elsewhere.

* Don't install a needless method on minitest. Prefer assigning the
  reporter anyway as that's what minitest does internally.

* Don't bother opting out when the reporter ain't a Minitest::CompositeReporter.
  It's hardcoded: 005a3ba42c/lib/minitest.rb (L125)
  And overrides have to create delegate reporters:
  1018b1b42f/lib/minitest/minitest_reporter_plugin.rb (L72)
2018-02-18 21:35:30 +01:00
Kevin Robatel
40a5ba30fb Add SuppressedSummaryReporter and TestUnitReporter only if necessary 2018-02-15 10:02:26 +01:00