Sha256: 983a20149f9f1f9421d4faa3ed458c6abf19552ab3fe2154d3a80ffc62d55e3a

Contents?: true

Size: 1.04 KB

Versions: 9

Compression:

Stored size: 1.04 KB

Contents

if ENV['COVERAGE'] || ENV['TRAVIS']
	begin
		require 'simplecov'
		
		SimpleCov.start do
			add_filter "/spec/"
		end
		
		# Work correctly across forks:
		pid = Process.pid
		SimpleCov.at_exit do
			SimpleCov.result.format! if Process.pid == pid
		end
		
		if ENV['TRAVIS']
			require 'coveralls'
			Coveralls.wear!
		end
	rescue LoadError
		warn "Could not load simplecov: #{$!}"
	end
end

require "bundler/setup"
require "async/rspec"
require "async/dns"

begin
	require 'ruby-prof'
	
	RSpec.shared_context "profile" do
		around(:each) do |example|
			profile = RubyProf.profile(merge_fibers: true) do
				example.run
			end
			
			printer = RubyProf::FlatPrinter.new(profile)
			printer.print(STDOUT)
		end
	end
rescue LoadError
	RSpec.shared_context "profile" do
		before(:all) do
			puts "Profiling not supported on this platform."
		end
	end
end

RSpec.configure do |config|
	# Enable flags like --only-failures and --next-failure
	config.example_status_persistence_file_path = ".rspec_status"

	config.expect_with :rspec do |c|
		c.syntax = :expect
	end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
async-dns-1.2.5 spec/spec_helper.rb
async-dns-1.2.4 spec/spec_helper.rb
async-dns-1.2.3 spec/spec_helper.rb
async-dns-1.2.2 spec/spec_helper.rb
async-dns-1.2.1 spec/spec_helper.rb
async-dns-1.2.0 spec/spec_helper.rb
async-dns-1.1.1 spec/spec_helper.rb
async-dns-1.1.0 spec/spec_helper.rb
async-dns-1.0.0 spec/spec_helper.rb