1
0
Fork 0
mirror of https://github.com/jnunemaker/httparty synced 2023-03-27 23:23:07 -04:00
httparty/features/steps/env.rb
2010-05-13 21:50:58 -04:00

23 lines
424 B
Ruby

require 'mongrel'
require 'activesupport'
require 'lib/httparty'
require 'spec/expectations'
Before do
def new_port
server = TCPServer.new('0.0.0.0', nil)
port = server.addr[1]
ensure
server.close
end
port = ENV["HTTPARTY_PORT"] || new_port
@host_and_port = "0.0.0.0:#{port}"
@server = Mongrel::HttpServer.new("0.0.0.0", port)
@server.run
@request_options = {}
end
After do
@server.stop
end