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

#recursive_const_defined?, #recursive_const_get

Instance Method Details

#should_not_receive(method_name) ⇒ Object



143
144
145
146
# File 'lib/rspec/fire.rb', line 143

def should_not_receive(method_name)
  ensure_implemented(method_name)
  super
end

#should_receive(method_name) ⇒ Object



138
139
140
141
# File 'lib/rspec/fire.rb', line 138

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

#stub(method_name) ⇒ Object



148
149
150
151
# File 'lib/rspec/fire.rb', line 148

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

#stub!(method_name) ⇒ Object



153
154
155
# File 'lib/rspec/fire.rb', line 153

def stub!(method_name)
  stub(method_name)
end

#with_doubled_classObject



157
158
159
160
161
162
163
164
165
166
# File 'lib/rspec/fire.rb', line 157

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