Sha256: 6863f6a06bcc9a4cdb0a896e9dfe86b0c83305c91901168febb2b947709b5519

Contents?: true

Size: 915 Bytes

Versions: 15

Compression:

Stored size: 915 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
	
	Console.logger.info(self){"Starting server..."}
	
	container.run(count: 1) do
		server = Async::HTTP::Server.for(endpoint, protocol: Async::HTTP::Protocol::HTTP2, scheme: "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

15 entries across 15 versions & 1 rubygems

Version Path
async-http-0.60.1 bake/async/http/h2spec.rb
async-http-0.60.0 bake/async/http/h2spec.rb
async-http-0.59.5 bake/async/http/h2spec.rb
async-http-0.59.4 bake/async/http/h2spec.rb
async-http-0.59.3 bake/async/http/h2spec.rb
async-http-0.59.2 bake/async/http/h2spec.rb
async-http-0.59.1 bake/async/http/h2spec.rb
async-http-0.59.0 bake/async/http/h2spec.rb
async-http-0.58.0 bake/async/http/h2spec.rb
async-http-0.57.0 bake/async/http/h2spec.rb
async-http-0.56.6 bake/async/http/h2spec.rb
async-http-0.56.5 bake/async/http/h2spec.rb
async-http-0.56.4 bake/async/http/h2spec.rb
async-http-0.56.3 bake/async/http/h2spec.rb
async-http-0.56.2 bake/async/http/h2spec.rb