Sha256: 4a78bf0b893fb1b651666412039db1beec07b9ad03ec01d45dc6eed550161163

Contents?: true

Size: 717 Bytes

Versions: 5

Compression:

Stored size: 717 Bytes

Contents

# frozen_string_literal: true

require_relative 'website_context'

# Learn about best practice specs from http://betterspecs.org
RSpec.describe "website", timeout: 120 do
	include_context "server"
	
	let(:spider) {Benchmark::HTTP::Spider.new(depth: 128)}
	let(:statistics) {Benchmark::HTTP::Statistics.new}
	
	it "should be responsive" do
		Async::HTTP::Client.open(endpoint, connection_limit: 8) do |client|
			spider.fetch(statistics, client, endpoint.url) do |method, uri, response|
				#if response.failure?
					Async.logger.error{"#{method} #{uri} -> #{response.status}"}
				#end
			end.wait
		end
		
		statistics.print
		
		expect(statistics.samples).to be_any
		expect(statistics.failed).to be_zero
	end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
utopia-2.12.4 setup/site/spec/website_spec.rb
utopia-2.12.3 setup/site/spec/website_spec.rb
utopia-2.12.2 setup/site/spec/website_spec.rb
utopia-2.12.1 setup/site/spec/website_spec.rb
utopia-2.12.0 setup/site/spec/website_spec.rb