Method: RSpec::Expectations::Syntax.warn_about_should_unless_configured

Defined in:
lib/rspec/expectations/syntax.rb

.warn_about_should_unless_configured(method_name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Generates a deprecation warning for the given method if no warning has already been issued.



25
26
27
28
29
30
31
32
33
34
# File 'lib/rspec/expectations/syntax.rb', line 25

def warn_about_should_unless_configured(method_name)
  return unless @warn_about_should

  RSpec.deprecate(
    "Using `#{method_name}` from rspec-expectations' old `:should` syntax without explicitly enabling the syntax",
    :replacement => "the new `:expect` syntax or explicitly enable `:should` with `config.expect_with(:rspec) { |c| c.syntax = :should }`"
  )

  @warn_about_should = false
end