mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Silence Minitest for plugin tests.
Fixes https://github.com/rails/rails/issues/17340. Use Minitest::BacktraceFilter instead of removing all silencers. This will allow the backtrace for all libraries in the plugin to be shown while removing noise generated by Minitest's backtrace.
This commit is contained in:
parent
72f4c7af10
commit
106db0b419
2 changed files with 4 additions and 1 deletions
|
@ -10,7 +10,9 @@ ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate',
|
|||
<% end -%>
|
||||
require "rails/test_help"
|
||||
|
||||
Rails.backtrace_cleaner.remove_silencers!
|
||||
# Filter out Minitest backtrace while allowing backtrace from other libraries
|
||||
# to be shown.
|
||||
Minitest.backtrace_filter = Minitest::BacktraceFilter.new
|
||||
|
||||
# Load support files
|
||||
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
||||
|
|
|
@ -57,6 +57,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase
|
|||
assert_file "test/test_helper.rb" do |content|
|
||||
assert_match(/require.+test\/dummy\/config\/environment/, content)
|
||||
assert_match(/ActiveRecord::Migrator\.migrations_paths.+test\/dummy\/db\/migrate/, content)
|
||||
assert_match(/Minitest\.backtrace_filter = Minitest::BacktraceFilter\.new/, content)
|
||||
end
|
||||
assert_file "test/bukkits_test.rb", /assert_kind_of Module, Bukkits/
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue