Sha256: d7312d9538ccd8f2d64172e44ac8095aaedb814d238a452ab4f10b968e9171bf

Contents?: true

Size: 895 Bytes

Versions: 22

Compression:

Stored size: 895 Bytes

Contents

def build
	# Fetch the code:
	system "go get github.com/spf13/cobra"
	system "go get github.com/summerwind/h2spec"
	
	# This builds `h2spec` into the current directory
	system "go build ~/go/src/github.com/summerwind/h2spec/cmd/h2spec/h2spec.go"
end

def test
	server do
		system("./h2spec", "-p", "7272")
	end
end

private

def server
	require 'async'
	require 'async/container'
	require 'async/http/server'
	require 'async/io/host_endpoint'
	
	endpoint = Async::IO::Endpoint.tcp('127.0.0.1', 7272)
	
	container = Async::Container.new
	
	Async.logger.info(self){"Starting server..."}
	
	container.run(count: 1) do
		server = Async::HTTP::Server.for(endpoint, Async::HTTP::Protocol::HTTP2, "https") do |request|
			Protocol::HTTP::Response[200, {'content-type' => 'text/plain'}, ["Hello World"]]
		end
		
		Async do
			server.run
		end
	end
	
	yield if block_given?
ensure
	container&.stop
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
async-http-0.53.1 bake/async/http/h2spec.rb
async-http-0.53.0 bake/async/http/h2spec.rb
async-http-0.52.5 bake/async/http/h2spec.rb
async-http-0.52.4 bake/async/http/h2spec.rb
async-http-0.52.3 bake/async/http/h2spec.rb
async-http-0.52.2 bake/async/http/h2spec.rb
async-http-0.52.1 bake/async/http/h2spec.rb
async-http-0.52.0 bake/async/http/h2spec.rb
async-http-0.51.6 bake/async/http/h2spec.rb
async-http-0.51.5 bake/async/http/h2spec.rb
async-http-0.51.4 bake/async/http/h2spec.rb
async-http-0.51.3 bake/async/http/h2spec.rb
async-http-0.51.2 bake/async/http/h2spec.rb
async-http-0.51.1 bake/async/http/h2spec.rb
async-http-0.51.0 bake/async/http/h2spec.rb
async-http-0.50.13 bake/async/http/h2spec.rb
async-http-0.50.12 bake/async/http/h2spec.rb
async-http-0.50.11 bake/async/http/h2spec.rb
async-http-0.50.10 bake/async/http/h2spec.rb
async-http-0.50.9 bake/async/http/h2spec.rb