module RSpec::Mocks::Syntax
def self.enable_expect(syntax_host = ::RSpec::Mocks::ExampleMethods)
- Api: - private
def self.enable_expect(syntax_host = ::RSpec::Mocks::ExampleMethods) return if expect_enabled?(syntax_host) syntax_host.class_eval do def receive(method_name, &block) Matchers::Receive.new(method_name, block) end def allow(target) AllowanceTarget.new(target) end def expect_any_instance_of(klass) AnyInstanceExpectationTarget.new(klass) end def allow_any_instance_of(klass) AnyInstanceAllowanceTarget.new(klass) end end RSpec::Mocks::ExampleMethods::ExpectHost.class_eval do def expect(target) ExpectationTarget.new(target) end end end