module RSpec::Mocks::Syntax

def self.enable_should(syntax_host = default_should_syntax_host)

Other tags:
    Api: - private
def self.enable_should(syntax_host = default_should_syntax_host)
  @warn_about_should = false if syntax_host == default_should_syntax_host
  return if should_enabled?(syntax_host)
  syntax_host.class_exec do
    def should_receive(message, opts={}, &block)
      ::RSpec::Mocks::Syntax.warn_unless_should_configured(__method__)
      ::RSpec::Mocks.expect_message(self, message, opts, &block)
    end
    def should_not_receive(message, &block)
      ::RSpec::Mocks::Syntax.warn_unless_should_configured(__method__)
      ::RSpec::Mocks.expect_message(self, message, {}, &block).never
    end
    def stub(message_or_hash, opts={}, &block)
      ::RSpec::Mocks::Syntax.warn_unless_should_configured(__method__)
      if ::Hash === message_or_hash
        message_or_hash.each {|message, value| stub(message).and_return value }
      else
        ::RSpec::Mocks.allow_message(self, message_or_hash, opts, &block)
      end
    end
    def unstub(message)
      ::RSpec::Mocks::Syntax.warn_unless_should_configured(__method__, "`allow(...).to_receive(...).and_call_original` or explicitly enable `:should`")
      ::RSpec::Mocks.space.proxy_for(self).remove_stub(message)
    end
    def stub_chain(*chain, &blk)
      ::RSpec::Mocks::Syntax.warn_unless_should_configured(__method__)
      ::RSpec::Mocks::StubChain.stub_chain_on(self, *chain, &blk)
    end
    def as_null_object
      ::RSpec::Mocks::Syntax.warn_unless_should_configured(__method__)
      @_null_object = true
      ::RSpec::Mocks.space.proxy_for(self).as_null_object
    end
    def null_object?
      ::RSpec::Mocks::Syntax.warn_unless_should_configured(__method__)
      defined?(@_null_object)
    end
    def received_message?(message, *args, &block)
      ::RSpec::Mocks::Syntax.warn_unless_should_configured(__method__)
      ::RSpec::Mocks.space.proxy_for(self).received_message?(message, *args, &block)
    end
    unless Class.respond_to? :any_instance
      Class.class_exec do
        def any_instance
          ::RSpec::Mocks::Syntax.warn_unless_should_configured(__method__)
          ::RSpec::Mocks.space.any_instance_proxy_for(self)
        end
      end
    end
  end
end