Class: RSpec::Mocks::AnyInstance::Chain

Inherits:
Object
  • Object
show all
Includes:
Customizations
Defined in:
lib/rspec/mocks/any_instance/chain.rb

Direct Known Subclasses

ExpectationChain

Defined Under Namespace

Modules: Customizations

Instance Method Summary (collapse)

Methods included from Customizations

#and_call_original, #and_raise, #and_return, #and_throw, #and_yield, #any_number_of_times, #at_least, #at_most, #exactly, #once, record, #times, #twice, #with

Constructor Details

- (Chain) initialize(recorder, *args)

A new instance of Chain



5
6
7
8
9
10
11
# File 'lib/rspec/mocks/any_instance/chain.rb', line 5

def initialize(recorder, *args, &block)
  @recorder          = recorder
  @expectation_args  = args
  @expectation_block = block
  @source_line       = CallerFilter.first_non_rspec_line
  ensure_expectation_block_has_source_location
end

Instance Method Details

- (Object) ensure_expectation_block_has_source_location



108
# File 'lib/rspec/mocks/any_instance/chain.rb', line 108

def ensure_expectation_block_has_source_location; end

- (Object) never



69
70
71
72
# File 'lib/rspec/mocks/any_instance/chain.rb', line 69

def never
  ErrorGenerator.raise_double_negation_error("expect_any_instance_of(MyClass)") if negated?
  super
end