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.32.0 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.31.0 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.30.1 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.30.0 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.29.1 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.29.0 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.28.0 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.27.0 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.26.0 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.25.1 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.25.0 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.24.0 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.23.0 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.22.2 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.22.1 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.22.0 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.21.0 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.20.1 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.20.0 spec/rubocop/cop/rspec/message_chain_spec.rb
rubocop-rspec-1.19.0 spec/rubocop/cop/rspec/message_chain_spec.rb