stub_chain (Spec::Mocks::Methods)

    # File lib/spec/mocks/methods.rb, line 28
          def stub_chain(*methods)
            if methods.length > 1
              if matching_stub = __mock_proxy.find_matching_method_stub(methods[0])
                methods.shift
                matching_stub.invoke_return_block.stub_chain(*methods)
              else
                next_in_chain = Object.new
                stub!(methods.shift) {next_in_chain}
                next_in_chain.stub_chain(*methods)
              end
            else
              stub!(methods.shift)
            end
          end