1
0
Fork 0
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:
Guo Xiang Tan 2014-12-02 01:31:06 +08:00
parent 72f4c7af10
commit 106db0b419
2 changed files with 4 additions and 1 deletions

View file

@ -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 }

View file

@ -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