Methods
- B
- D
- F
- G
- H
- I
- M
- P
- R
- S
Included Modules
- Rack::Utils START:includes
Constants
| RACK_OPTIONS | = | { :accept => 'HTTP_ACCEPT', :agent => 'HTTP_USER_AGENT', :host => 'HTTP_HOST', :session => 'rack.session', :cookies => 'HTTP_COOKIE', :content_type => 'CONTENT_TYPE' } |
Attributes
| [R] | app | |
| [R] | request | |
| [R] | response |
Class Public methods
Instance Public methods
# File lib/sinatra/test.rb, line 24 24: def make_request(verb, path, body=nil, options={}) 25: @app = Sinatra::Application if @app.nil? && defined?(Sinatra::Application) 26: fail "@app not set - cannot make request" if @app.nil? 27: 28: @request = Rack::MockRequest.new(@app) 29: options = { :lint => true }.merge(options || {}) 30: 31: case 32: when body.respond_to?(:to_hash) 33: options.merge! body.delete(:env) if body.key?(:env) 34: options[:input] = param_string(body) 35: when body.respond_to?(:to_str) 36: options[:input] = body 37: when body.nil? 38: options[:input] = '' 39: else 40: raise ArgumentError, "body must be a Hash, String, or nil" 41: end 42: 43: yield @request if block_given? 44: @response = @request.request(verb, path, rack_options(options)) 45: end
Delegate other missing methods to @response.
Also check @response since we delegate there.