How to avoid deprecation warning for stub_chain in RSpec 3.0?

后端 未结 4 1836
清歌不尽
清歌不尽 2020-12-13 09:26

When I run a test with stub_chain, I\'ll get a deprecation warning.

describe \"stubbing a chain of methods\" do
  subject { Object.new }

  context \"given s         


        
4条回答
  •  生来不讨喜
    2020-12-13 09:57

    RSpec.configure do |config|
      config.mock_with :rspec do |c|
        c.syntax = [:should, :expect]
      end
    end
    

    Notice that it's setting the rspec-mocks syntax, not the rspec-expectations syntax, as Paul's answer shows.

提交回复
热议问题