Class: RSpec::Mocks::ProxyForNil

Inherits:
PartialDoubleProxy show all
Defined in:
lib/rspec/mocks/proxy.rb

Instance Attribute Summary (collapse)

Attributes inherited from Proxy

#object

Instance Method Summary (collapse)

Methods inherited from PartialDoubleProxy

#add_simple_expectation, #add_simple_stub, #original_method_handle_for, #reset, #visibility_for

Methods inherited from Proxy

#add_simple_expectation, #add_simple_stub, #as_null_object, #build_expectation, #check_for_unexpected_arguments, #has_negative_expectation?, #message_received, #null_object?, #original_method_handle_for, #prepended_modules_of_singleton_class, #raise_missing_default_stub_error, #raise_unexpected_message_args_error, #raise_unexpected_message_error, #received_message?, #record_message_received, #remove_stub, #remove_stub_if_present, #replay_received_message_on, #reset, #verify, #visibility_for

Constructor Details

- (ProxyForNil) initialize(order_group)



377
378
379
380
# File 'lib/rspec/mocks/proxy.rb', line 377

def initialize(order_group)
  @warn_about_expectations = true
  super(nil, order_group)
end

Instance Attribute Details

- (Object) warn_about_expectations Also known as: warn_about_expectations?

Returns the value of attribute warn_about_expectations



382
383
384
# File 'lib/rspec/mocks/proxy.rb', line 382

def warn_about_expectations
  @warn_about_expectations
end

Instance Method Details

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



385
386
387
388
# File 'lib/rspec/mocks/proxy.rb', line 385

def add_message_expectation(method_name, opts={}, &block)
  warn(method_name) if warn_about_expectations?
  super
end

- (Object) add_negative_message_expectation(location, method_name, &implementation)



390
391
392
393
# File 'lib/rspec/mocks/proxy.rb', line 390

def add_negative_message_expectation(location, method_name, &implementation)
  warn(method_name) if warn_about_expectations?
  super
end

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



395
396
397
398
# File 'lib/rspec/mocks/proxy.rb', line 395

def add_stub(method_name, opts={}, &implementation)
  warn(method_name) if warn_about_expectations?
  super
end