Class: Minitest::Test
- Inherits:
-
Object
- Object
- Minitest::Test
- Defined in:
- lib/minitest/proveit.rb,
lib/minitest/proveit.rb
Overview
Hooks Minitest::Test.run to enforce prove_it! for all tests.
TODO: to be moved to minitest/hell?
Constant Summary collapse
- VERSION =
:nodoc:
"1.0.0"
Class Method Summary collapse
-
.prove_it ⇒ Object
Getter for prove_it class variable.
-
.prove_it! ⇒ Object
Call this at the top of your tests when you want to force all tests to prove success (via at least one assertion) rather than rely on the absence of failure.
-
.prove_it=(o) ⇒ Object
Setter for prove_it class variable.
- .run(reporter, options = {}) ⇒ Object
Instance Method Summary collapse
-
#assert_proven? ⇒ Boolean
:nodoc:.
Class Method Details
.prove_it ⇒ Object
Getter for prove_it class variable
11 12 13 |
# File 'lib/minitest/proveit.rb', line 11 def self.prove_it @@prove_it ||= false end |
.prove_it! ⇒ Object
Call this at the top of your tests when you want to force all tests to prove success (via at least one assertion) rather than rely on the absence of failure.
27 28 29 |
# File 'lib/minitest/proveit.rb', line 27 def self.prove_it! @@prove_it = true unless defined? @@prove_it end |
.prove_it=(o) ⇒ Object
Setter for prove_it class variable. true/false
18 19 20 |
# File 'lib/minitest/proveit.rb', line 18 def self.prove_it= o @@prove_it = o end |
.run(reporter, options = {}) ⇒ Object
45 46 47 48 |
# File 'lib/minitest/proveit.rb', line 45 def self.run reporter, = {} # :nodoc: prove_it! super end |
Instance Method Details
#assert_proven? ⇒ Boolean
:nodoc:
33 34 35 36 |
# File 'lib/minitest/proveit.rb', line 33 def assert_proven? # :nodoc: flunk "Absence of failure is not success. Prove it!" if self.class.prove_it && self.failures.empty? && self.assertions == 0 end |