Module: RSpec::Fire::FireDoublable

Includes:
RecursiveConstMethods
Included in:
FireClassDouble, FireObjectDouble
Defined in:
lib/rspec/fire/legacy.rb

Instance Method Summary collapse

Methods included from RecursiveConstMethods

#const_defined_on?, #get_const_defined_on, #recursive_const_defined?, #recursive_const_get

Instance Method Details

#should_not_receive(method_name) ⇒ Object



166
167
168
169
# File 'lib/rspec/fire/legacy.rb', line 166

def should_not_receive(method_name)
  ensure_implemented(method_name)
  super
end

#should_receive(method_name) ⇒ Object



161
162
163
164
# File 'lib/rspec/fire/legacy.rb', line 161

def should_receive(method_name)
  ensure_implemented(method_name)
  ShouldProxy.new(self, @__method_finder, super)
end

#stub(method_name) ⇒ Object



171
172
173
174
# File 'lib/rspec/fire/legacy.rb', line 171

def stub(method_name)
  ensure_implemented(method_name) unless method_name.is_a?(Hash)
  super
end

#stub!(method_name) ⇒ Object



176
177
178
# File 'lib/rspec/fire/legacy.rb', line 176

def stub!(method_name)
  stub(method_name)
end

#with_doubled_classObject



180
181
182
183
184
185
186
187
188
189
# File 'lib/rspec/fire/legacy.rb', line 180

def with_doubled_class
  ::RSpec::Fire.find_original_value_for(@__doubled_class_name) do |value|
    yield value if value
    return
  end

  if recursive_const_defined?(@__doubled_class_name)
    yield recursive_const_get(@__doubled_class_name)
  end
end