diff --git a/lib/deprecation_toolkit/behaviors/raise.rb b/lib/deprecation_toolkit/behaviors/raise.rb index a12eff3..0e9dcd2 100644 --- a/lib/deprecation_toolkit/behaviors/raise.rb +++ b/lib/deprecation_toolkit/behaviors/raise.rb @@ -34,7 +34,9 @@ def initialize(current_deprecations, recorded_deprecations) You have introduced new deprecations in the codebase. Fix or record them in order to discard this error. #{record_message} + ******* The following deprecations were added: ******* #{introduced_deprecations.join("\n")} + ****************************************************** EOM super(message) @@ -57,7 +59,9 @@ def initialize(current_deprecations, recorded_deprecations) The recorded deprecations needs to be updated to reflect your changes. #{record_message} + ****** The following deprecations were removed: ****** #{removed_deprecations.join("\n")} + ****************************************************** EOM super(message) diff --git a/test/deprecation_toolkit/behaviors/raise_test.rb b/test/deprecation_toolkit/behaviors/raise_test.rb index 2446d37..5bcea5b 100644 --- a/test/deprecation_toolkit/behaviors/raise_test.rb +++ b/test/deprecation_toolkit/behaviors/raise_test.rb @@ -34,21 +34,25 @@ class RaiseTest < ActiveSupport::TestCase The recorded deprecations needs to be updated to reflect your changes. You can re-record deprecations by adding the `--record-deprecations` flag when running your tests. + ****** The following deprecations were removed: ****** DEPRECATION WARNING: Bar + ****************************************************** EOM deprecator.warn("Foo") end - test ".trigger raises a DeprecationRemoved when less deprecations than expected are triggerd and mismatches" do + test ".trigger raises a DeprecationRemoved when less deprecations than expected are triggered and mismatches" do @expected_exception_class = DeprecationRemoved @expected_exception_message = <<~EOM You have removed deprecations from the codebase. Thanks for being an awesome person. The recorded deprecations needs to be updated to reflect your changes. You can re-record deprecations by adding the `--record-deprecations` flag when running your tests. + ****** The following deprecations were removed: ****** DEPRECATION WARNING: A DEPRECATION WARNING: B + ****************************************************** EOM deprecator.warn("C") diff --git a/test/deprecations/deprecation_toolkit/behaviors/raise_test.yml b/test/deprecations/deprecation_toolkit/behaviors/raise_test.yml index 6e9b4d6..145be4b 100644 --- a/test/deprecations/deprecation_toolkit/behaviors/raise_test.yml +++ b/test/deprecations/deprecation_toolkit/behaviors/raise_test.yml @@ -5,7 +5,7 @@ test_.trigger_raises_a_DeprecationRemoved_error_when_deprecations_are_removed: test_.trigger_does_not_raise_when_deprecations_are_triggered_but_were_already_recorded: - 'DEPRECATION WARNING: Foo' - 'DEPRECATION WARNING: Bar' -test_.trigger_raises_a_DeprecationRemoved_when_less_deprecations_than_expected_are_triggerd_and_mismatches: +test_.trigger_raises_a_DeprecationRemoved_when_less_deprecations_than_expected_are_triggered_and_mismatches: - 'DEPRECATION WARNING: A' - 'DEPRECATION WARNING: B' test_.trigger_raises_a_DeprecationMismatch_when_same_number_of_deprecations_are_triggered_with_mismatches: