Class: DeprecationToolkit::Behaviors::DeprecationMismatch
- Inherits:
-
DeprecationException
- Object
- DeprecationToolkit::Behaviors::DeprecationMismatch
- Defined in:
- lib/deprecation_toolkit/behaviors/raise.rb
Instance Method Summary collapse
-
#initialize(current_deprecations, recorded_deprecations) ⇒ DeprecationMismatch
constructor
A new instance of DeprecationMismatch.
Constructor Details
#initialize(current_deprecations, recorded_deprecations) ⇒ DeprecationMismatch
Returns a new instance of DeprecationMismatch.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/deprecation_toolkit/behaviors/raise.rb', line 68 def initialize(current_deprecations, recorded_deprecations) = if DeprecationToolkit::Configuration.test_runner == :rspec "You can re-record deprecations by adding the `DEPRECATION_BEHAVIOR='record'` ENV when running your specs." else "You can re-record deprecations by adding the `--record-deprecations` flag when running your tests." end = <<~EOM The recorded deprecations for this test doesn't match the one that got triggered. Fix or record the new deprecations to discard this error. #{} ===== Expected #{recorded_deprecations.deprecations_without_stacktrace.join("\n")} ===== Actual #{current_deprecations.deprecations_without_stacktrace.join("\n")} EOM super() end |