Sha256: f858c211ce0cb04a48d47f6f973507d3a1169cbe9c02d9114d524542a28acf68

Contents?: true

Size: 509 Bytes

Versions: 2

Compression:

Stored size: 509 Bytes

Contents

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tap-mechanize-0.5.1 lib/tap/mechanize/test/echo_server.rb
tap-mechanize-0.5.0 lib/tap/mechanize/test/echo_server.rb