spec/integration/utils/dummy_server.rb in pacto-0.2.1 vs spec/integration/utils/dummy_server.rb in pacto-0.2.2
- old
+ new
@@ -12,14 +12,14 @@
response.body = @json
end
end
class DummyServer
- def initialize
- @server = WEBrick::HTTPServer.new :Port => 8000,
+ def initialize port, path, response
+ @server = WEBrick::HTTPServer.new :Port => port,
:AccessLog => [],
:Logger => WEBrick::Log::new("/dev/null", 7)
- @server.mount "/simple_contract.json", Servlet, '{"message": "Hello World!"}'
+ @server.mount path, Servlet, response
end
def start
@pid = fork do
trap 'INT' do @server.shutdown end