Module: RSpec::Mocks::VerifyingProxyMethods

Included in:
VerifyingPartialDoubleProxy, VerifyingProxy
Defined in:
lib/rspec/mocks/verifying_proxy.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) add_message_expectation(method_name, opts = {}, &block)



19
20
21
22
# File 'lib/rspec/mocks/verifying_proxy.rb', line 19

def add_message_expectation(method_name, opts={}, &block)
  ensure_implemented(method_name)
  super
end

- (Object) add_simple_stub(method_name, *args)



14
15
16
17
# File 'lib/rspec/mocks/verifying_proxy.rb', line 14

def add_simple_stub(method_name, *args)
  ensure_implemented(method_name)
  super
end

- (Object) add_stub(method_name, opts = {}, &implementation)



9
10
11
12
# File 'lib/rspec/mocks/verifying_proxy.rb', line 9

def add_stub(method_name, opts={}, &implementation)
  ensure_implemented(method_name)
  super
end

- (Object) ensure_implemented(method_name)



24
25
26
27
28
29
30
31
# File 'lib/rspec/mocks/verifying_proxy.rb', line 24

def ensure_implemented(method_name)
  if method_reference[method_name].unimplemented?
    @error_generator.raise_unimplemented_error(
      @doubled_module,
      method_name
    )
  end
end

- (Object) ensure_publicly_implemented(method_name, object)



33
34
35
36
37
38
39
40
# File 'lib/rspec/mocks/verifying_proxy.rb', line 33

def ensure_publicly_implemented(method_name, object)
  ensure_implemented(method_name)
  visibility = method_reference[method_name].visibility

  unless visibility == :public
    @error_generator.raise_non_public_error(method_name, visibility)
  end
end