title: Generate an HTTP response in Ruby
body: <p>I'm working on an application that reaches out to a web service. I'd like to develop a proxy class that returns a fake response from the service, so I don't have to constantly be hitting it with requests while I'm developing/testing other parts of the app.</p>
  
  <p>My application is expecting a response generated via Net::HTTP.</p>
  
  <pre><code>response = Net::HTTP.get(URI.parse('http://foo.com'))
  
  case response
  when Net::HTTPOK
    # do something fun
  
  when Net::HTTPUnauthorized
    # you get the idea
  </code></pre>
  
  <p>How can I manufacture a response object, give it all the right headers, return a body string, etc?</p>
  
  <pre><code>response = ProxyClass.response_object
  
  case response
  when Net::HTTPOk
    # my app doesn't know it's being lied to
  </code></pre>
  
  <p>Thanks.</p>