fixed Irb errors

This commit is contained in:
blake.mizerany@gmail.com 2007-09-11 01:14:14 +00:00
parent 436f1fd14a
commit 1de67c2d6c
2 changed files with 5 additions and 7 deletions

View File

@ -26,7 +26,7 @@ module Sinatra
status 404
views_dir SINATRA_ROOT + '/files'
if request.path_info == '/'
if request.path_info == '/' && request.request_method == 'GET'
erb :default_index
else
erb :not_found

View File

@ -4,8 +4,6 @@ module Sinatra
module TestMethods
@response = nil unless defined?("@response")
%w(get post put delete).each do |verb|
module_eval <<-end_eval
def #{verb}_it(path, params = {})
@ -17,22 +15,22 @@ module Sinatra
end
def response
@response
@response || Rack::MockResponse.new(404, {}, '')
end
def status
@response.status
response.status
end
def text
@response.body
response.body
end
alias :xml :text
alias :html :text
alias :body :text
def headers
@response.headers
response.headers
end
private