Sha256: baf46b85825915dec8bd61e88d4ab4b746e233b797808ca6b88f4f45419a98e5
Contents?: true
Size: 838 Bytes
Versions: 7
Compression:
Stored size: 838 Bytes
Contents
# frozen_string_literal: true require "spec_helper" describe RuboCop::Cop::Discourse::NoMockingJobs, :config do subject(:cop) { described_class.new(config) } let(:config) { RuboCop::Config.new } it "raises an offense if Jobs is mocked with :enqueue" do offenses = inspect_source(<<~RUBY) Jobs.expects(:enqueue) RUBY expect(offenses.first.message).to end_with(described_class::MSG) end it "raises an offense if Jobs is mocked with :enqueue_in" do offenses = inspect_source(<<~RUBY) Jobs.expects(:enqueue_in) RUBY expect(offenses.first.message).to end_with(described_class::MSG) end it "does not raise an offense if Jobs is not mocked with :enqueue or :enqueue_in" do offenses = inspect_source(<<~RUBY) Jobs.enqueue(:some_job) RUBY expect(offenses).to eq([]) end end
Version data entries
7 entries across 7 versions & 1 rubygems