Sha256: 23b261c0e3f06899bedeb3d1354314c5d34d15265b5b429210feeae3055826cf

Contents?: true

Size: 585 Bytes

Versions: 24

Compression:

Stored size: 585 Bytes

Contents

RSpec.describe RuboCop::Cop::RSpec::MessageChain do
  subject(:cop) { described_class.new }

  it 'finds `receive_message_chain`' do
    expect_offense(<<-RUBY)
      before do
        allow(foo).to receive_message_chain(:one, :two) { :three }
                      ^^^^^^^^^^^^^^^^^^^^^ Avoid stubbing using `receive_message_chain`.
      end
    RUBY
  end

  it 'finds old `stub_chain` syntax' do
    expect_offense(<<-RUBY)
      before do
        foo.stub_chain(:one, :two).and_return(:three)
            ^^^^^^^^^^ Avoid stubbing using `stub_chain`.
      end
    RUBY
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rubocop-rspec-1.18.0 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.17.1 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.17.0 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.16.0 spec/rubocop/cop/rspec/message_chain_spec.rb