Skip to content

Commit 16a6547

Browse files
committed
test: make tests that emit a deprecation warning fail
Deprecation warnings should not be ignored. This is important so that: * when a user sees a deprecation warning, they can be confident it is coming from their code and not this gem * test output is clean and does not contain noisey deprecation warnings Tests whose purpose is to test that a deprecation warning is issued in the right circumstance should mock Git::Deprecation#warn to avoid raising an error.
1 parent 97903a8 commit 16a6547

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tests/test_helper.rb

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,19 @@
1212
$stdout.sync = true
1313
$stderr.sync = true
1414

15-
# # Silence deprecation warnings during tests
16-
# Git::Deprecation.behavior = :silence
15+
# Make tests that emit a deprecation warning fail
16+
17+
# Deprecation warnings should not be ignored.
18+
19+
# This is important so that:
20+
# * when a user sees a deprecation warning, they can be confident it is coming from
21+
# their code and not this gem
22+
# * test output is clean and does not contain noisey deprecation warnings
23+
24+
# Tests whose purpose is to test that a deprecation warning is issued in the right
25+
# circumstance should mock Git::Deprecation#warn to avoid raising an error.
26+
#
27+
Git::Deprecation.behavior = :raise
1728

1829
module Test
1930
module Unit

0 commit comments

Comments
 (0)