Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions spec/support/dummy_server/servlet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ def self.sockets
@sockets ||= []
end

def not_found(_req, res)
def not_found(req, res)
res.status = 404
res.body = "Not Found"
res.body = "#{req.unparsed_uri} not found"
end

def self.handlers
Expand All @@ -27,7 +27,7 @@ def self.#{method}(path, &block)
def do_#{method.upcase}(req, res)
handler = self.class.handlers["#{method}:\#{req.path}"]
return instance_exec(req, res, &handler) if handler
not_found
not_found(req, res)
end
RUBY
end
Expand Down Expand Up @@ -68,7 +68,7 @@ def do_#{method.upcase}(req, res)
end

get "/params" do |req, res|
next not_found unless "foo=bar" == req.query_string
next not_found(req, res) unless "foo=bar" == req.query_string

res.status = 200
res.body = "Params!"
Expand All @@ -77,7 +77,7 @@ def do_#{method.upcase}(req, res)
get "/multiple-params" do |req, res|
params = CGI.parse req.query_string

next not_found unless {"foo" => ["bar"], "baz" => ["quux"]} == params
next not_found(req, res) unless {"foo" => ["bar"], "baz" => ["quux"]} == params

res.status = 200
res.body = "More Params!"
Expand Down