Sha256: 886c4abd2b712454e06398b84a600ea6a6d715e40daf6db14d35385a9b49e493

Contents?: true

Size: 640 Bytes

Versions: 4

Compression:

Stored size: 640 Bytes

Contents

# typed: strict
# frozen_string_literal: true

module Spoom
  module Deadcode
    module Plugins
      class Minitest < Base
        extend T::Sig

        ignore_classes_named(/Test$/)

        ignore_methods_named(
          "after_all",
          "around",
          "around_all",
          "before_all",
          "setup",
          "teardown",
        )

        sig { override.params(indexer: Indexer, definition: Definition).void }
        def on_define_method(indexer, definition)
          definition.ignored! if indexer.path.match?(%r{test/.*test\.rb$}) && definition.name.match?(/^test_/)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spoom-1.3.2 lib/spoom/deadcode/plugins/minitest.rb
spoom-1.3.1 lib/spoom/deadcode/plugins/minitest.rb
spoom-1.3.0 lib/spoom/deadcode/plugins/minitest.rb
spoom-1.2.4 lib/spoom/deadcode/plugins/minitest.rb