Sha256: 6b452b4d85d2c9001194d1d66ec6bd884f675e29ca29772c91a41916fbf69956

Contents?: true

Size: 857 Bytes

Versions: 2

Compression:

Stored size: 857 Bytes

Contents

begin
  require 'spec/interop/test'
rescue Gem::LoadError => e
  raise(e)
rescue ::LoadError
  STDERR.puts "Error: please install the test-unit gem in order to run the spec tests"
  exit -1
end

begin
  require 'rack/test'
rescue Gem::LoadError => e
  raise(e)
rescue ::LoadError
  STDERR.puts "Error: please install the rack-test gem in order to run the spec tests"
  exit -1
end

module Helpers
  module Web
    module Server
      include Rack::Test::Methods

      def app=(server)
        @app = server
        @app.set :environment, :test
      end

      def app
        @app
      end

      def get_host(path,host,params={},headers={})
        get(path,params,headers.merge('HTTP_HOST' => host))
      end

      def post_host(path,host,params={},headers={})
        post(path,params,headers.merge('HTTP_HOST' => host))
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ronin-web-0.2.1 spec/web/server/helpers/server.rb
ronin-web-0.2.0 spec/web/server/helpers/server.rb