Class: Minitest::Test

Inherits:
Object
  • Object
show all
Defined in:
lib/minitest/holdify_plugin.rb

Overview

Reopen the minitest class

Instance Method Summary collapse

Instance Method Details

#before_teardownObject

Ensure store is tidied and saved after the test runs



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/minitest/holdify_plugin.rb', line 59

def before_teardown
  super
  return unless failures.empty? && @hold

  @hold.save
  return unless @hold.forced.any?

  path, = method(name).source_location
  msg   = +%([HOLDIFY] Reconciled values (Remove the "!" suffix to pass the test)\n)
  msg  << @hold.forced.uniq.map { |lineno| "  #{path}:#{lineno}" }.join("\n")

  flunk msg
end