Object
# File lib/rspec/mocks/any_instance.rb, line 136 def instance_that_received(method_name) @played_methods[method_name] end
# File lib/rspec/mocks/any_instance.rb, line 129 def playback!(instance, method_name) RSpec::Mocks::space.add(instance) @message_chains[method_name].playback!(instance) @played_methods[method_name] = instance received_expected_message!(method_name) if has_expectation?(method_name) end
# File lib/rspec/mocks/any_instance.rb, line 117 def should_receive(method_name, *args, &block) observe!(method_name) @expectation_set = true @message_chains[method_name] = ExpectationChain.new(method_name, *args, &block) end
# File lib/rspec/mocks/any_instance.rb, line 123 def stop_all_observation! @observed_methods.each do |method_name| restore_method!(method_name) end end
# File lib/rspec/mocks/any_instance.rb, line 112 def stub(method_name, *args, &block) observe!(method_name) @message_chains[method_name] = StubChain.new(method_name, *args, &block) end
# File lib/rspec/mocks/any_instance.rb, line 140 def verify if @expectation_set && !each_expectation_filfilled? raise RSpec::Mocks::MockExpectationError, "Exactly one instance should have received the following message(s) but didn't: #{unfulfilled_expectations.sort.join(', ')}" end end
Generated with the Darkfish Rdoc Generator 2.