Skip to content

Commit

Permalink
Silence Minitest for plugin tests.
Browse files Browse the repository at this point in the history
Fixes #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.
  • Loading branch information
tgxworld committed Dec 2, 2014
1 parent 72f4c7a commit 106db0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Expand Up @@ -10,7 +10,9 @@
<% 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 }
Expand Down
1 change: 1 addition & 0 deletions railties/test/generators/plugin_generator_test.rb
Expand Up @@ -57,6 +57,7 @@ def test_generating_without_options
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
Expand Down

0 comments on commit 106db0b

Please sign in to comment.