File: aggregate_failures.rb

package info (click to toggle)
ruby-test-prof 0.12.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 508 kB
  • sloc: ruby: 4,075; makefile: 4
file content (26 lines) | stat: -rw-r--r-- 552 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

module RuboCop
  module Cop
    module RSpec
      class AggregateExamples
        def self.registry
          RuboCop::Cop::Cop.registry
        end
      end

      class AggregateFailures < AggregateExamples
        def initialize(*)
          super
          self.class.just_once { warn "`AggregateFailures` cop has been renamed to `AggregateExamples`." }
        end

        def self.just_once
          return if @already_done
          yield
          @already_done = true
        end
      end
    end
  end
end