module Tap module Mechanize module Test # EchoServer is a Rack application that simply echos back the request # environment. The response is: # # [200, {request headers}, [request body]] # class EchoServer def self.call(env) body = env['rack.input'].read headers = {} env.each_pair {|key, value| headers[key] = value unless key =~ /^rack/ } [200, headers, [body]] end end end end end