How to remove RSpec "old syntax" deprecation warnings

RSpec 3.0 deprecates the :should way of writing specs for expecting things to happen Show archive.org snapshot .

However, if you have tests you cannot change (e.g. because they are inside a gem, spanning multiple versions of Rails and RSpec), you can explicitly allow the deprecated syntax.

Fix

Inside spec/spec_helpber.rb, set rspec-expectations’ and/or rspec-mocks’ syntax as following:

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

Note that you may set it to only one of the syntax options, too. The above code is for maximum compatibility.

Dominik Schöler