Sha256: 337d49718e99776cced9ccdbcf3ce630b100d7cfe09c2b9f437f190db9e4a784

Contents?: true

Size: 810 Bytes

Versions: 1

Compression:

Stored size: 810 Bytes

Contents

require 'async/rspec'

require 'cloudflare/rspec/connection'
require 'cloudflare/zones'

RSpec.shared_context Cloudflare::Zone do
	include_context Cloudflare::RSpec::Connection
	
	let(:job_id) {ENV.fetch('TRAVIS_JOB_ID', 0).to_i}
	let(:names) {['testing', 'horse', 'cat', 'dog', 'fish', 'dolphin', 'lion', 'tiger']}
	let(:name) {"#{names[job_id % names.size]}.com"}
	
	let(:account) {connection.accounts.first}
	let(:zones) {connection.zones}
	
	let(:zone) {@zone = zones.find_by_name(name) || zones.create(name, account)}
	
	# after do
	# 	if defined? @zone
	# 		@zone.delete
	# 	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

1 entries across 1 versions & 1 rubygems

Version Path
cloudflare-4.0.0 spec/spec_helper.rb