Sha256: 79e368b02ff417c2fe4776a17852e27d058eed78ed37ef8cef61d95e4b1fcd64
Contents?: true
Size: 919 Bytes
Versions: 4
Compression:
Stored size: 919 Bytes
Contents
RSpec.describe RuboCop::Cop::RSpec::AnyInstance do subject(:cop) { described_class.new } it 'finds `allow_any_instance_of` instead of an instance double' do expect_violation(<<-RUBY) before do allow_any_instance_of(Object).to receive(:foo) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Avoid stubbing using `allow_any_instance_of`. end RUBY end it 'finds `expect_any_instance_of` instead of an instance double' do expect_violation(<<-RUBY) before do expect_any_instance_of(Object).to receive(:foo) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Avoid stubbing using `expect_any_instance_of`. end RUBY end it 'finds old `any_instance` syntax instead of an instance double' do expect_violation(<<-RUBY) before do Object.any_instance.should_receive(:foo) ^^^^^^^^^^^^^^^^^^^ Avoid stubbing using `any_instance`. end RUBY end end
Version data entries
4 entries across 4 versions & 1 rubygems