Skip to content

Instantly share code, notes, and snippets.

@quirkey
Forked from bmizerany/irb
Created April 22, 2009 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save quirkey/99771 to your computer and use it in GitHub Desktop.
Save quirkey/99771 to your computer and use it in GitHub Desktop.
[08:48 AM:gist-99771(master)] $ irb -rubygems -r myapp.rb -r rack/test
>> app = Rack::Test::Session.new(Sinatra::Application)
=> #<Rack::Test::Session:0x17e8820 @headers={}, @app=Sinatra::Application>
>> app.get '/'
=> #<Rack::Response:0x17ad4dc @block=nil, @writer=#<Proc:0x0189f7b4@/opt/local/lib/ruby/gems/1.8/gems/rack-0.9.1/lib/rack/response.rb:24>, header{"Content-Type"=>"text/html", "Content-Length"=>"7"}, body["testing"], length7, status200
>> app.body
NoMethodError: undefined method `body' for #<Rack::Test::Session:0x17e8820>
from (irb):3
>> app.last_response.body
=> ["testing"]
require 'sinatra'
get '/' do
'testing'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment