Module: RSpec::Fire::FireDoublable

Extended by:
Matchers::DSL
Includes:
RecursiveConstMethods
Included in:
FireObjectDouble
Defined in:
lib/rspec/fire.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



182
183
184
185
# File 'lib/rspec/fire.rb', line 182

def should_not_receive(method_name)
  ensure_implemented(method_name)
  super
end

#should_receive(method_name) ⇒ Object



177
178
179
180
# File 'lib/rspec/fire.rb', line 177

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

#stub(method_name) ⇒ Object



187
188
189
190
# File 'lib/rspec/fire.rb', line 187

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

#stub!(method_name) ⇒ Object



192
193
194
# File 'lib/rspec/fire.rb', line 192

def stub!(method_name)
  stub(method_name)
end

#with_doubled_classObject



196
197
198
199
200
201
202
203
204
205
# File 'lib/rspec/fire.rb', line 196

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