Sha256: f09dfc4e0307046f8f850c420f5d837dc011f13800481d9e2a3552382301a584

Contents?: true

Size: 465 Bytes

Versions: 1

Compression:

Stored size: 465 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Discourse
      class NoMockingJobs < Cop
        MSG = "Use the test helpers provided by Sidekiq instead of mocking `Jobs`."

        def_node_matcher :mocking_jobs?, <<~MATCHER
        (send (const nil? :Jobs) :expects ...)
        MATCHER

        def on_send(node)
          return unless mocking_jobs?(node)
          add_offense(node, message: MSG)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubocop-discourse-2.3.0 lib/rubocop/cop/discourse/no_mocking_jobs.rb