class DeprecationToolkit::Behaviors::DeprecationRemoved

Public Class Methods

new(current_deprecations, recorded_deprecations) click to toggle source
Calls superclass method
# File lib/deprecation_toolkit/behaviors/raise.rb, line 43
      def initialize(current_deprecations, recorded_deprecations)
        removed_deprecations = recorded_deprecations - current_deprecations

        record_message =
          if DeprecationToolkit::Configuration.test_runner == :rspec
            "You can re-record deprecations by setting 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

        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.
          #{record_message}

          #{removed_deprecations.join("\n")}
        EOM

        super(message)
      end