2020-11-19 02:06:45 +00:00
|
|
|
# -*- ruby -*-
|
|
|
|
|
# vim: set noet sta sw=4 ts=4 :
|
|
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ENV[ 'COVERAGE' ]
|
|
|
|
|
require 'simplecov'
|
2021-02-14 09:47:04 +00:00
|
|
|
require 'simplecov-console'
|
|
|
|
|
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
|
|
|
|
|
SimpleCov::Formatter::HTMLFormatter,
|
|
|
|
|
SimpleCov::Formatter::Console,
|
|
|
|
|
])
|
|
|
|
|
SimpleCov.start do
|
|
|
|
|
add_filter 'spec'
|
|
|
|
|
# enable_coverage :branch
|
|
|
|
|
add_group "Needing tests" do |file|
|
|
|
|
|
file.covered_percent < 90
|
|
|
|
|
end
|
|
|
|
|
end
|
2020-11-19 02:06:45 +00:00
|
|
|
end
|
|
|
|
|
|
2020-11-30 05:57:26 +00:00
|
|
|
require 'pathname'
|
2020-11-19 02:06:45 +00:00
|
|
|
require 'rspec'
|
|
|
|
|
require 'mdbx'
|
|
|
|
|
|
|
|
|
|
|
2020-11-30 05:57:26 +00:00
|
|
|
module MDBX::Testing
|
2020-12-17 01:09:43 +00:00
|
|
|
TEST_DATABASE = Pathname( __FILE__ ).parent.parent.parent + 'tmp' + 'testdb'
|
2020-11-30 05:57:26 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
2020-11-19 02:06:45 +00:00
|
|
|
RSpec.configure do |config|
|
2020-11-30 05:57:26 +00:00
|
|
|
include MDBX::Testing
|
|
|
|
|
|
2020-11-19 02:06:45 +00:00
|
|
|
config.expect_with :rspec do |expectations|
|
|
|
|
|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
|
|
|
|
expectations.syntax = :expect
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
config.mock_with( :rspec ) do |mock|
|
|
|
|
|
mock.syntax = :expect
|
|
|
|
|
mock.verify_partial_doubles = true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
config.disable_monkey_patching!
|
|
|
|
|
config.example_status_persistence_file_path = "spec/.status"
|
|
|
|
|
config.filter_run :focus
|
|
|
|
|
config.filter_run_when_matching :focus
|
|
|
|
|
config.order = :random
|
|
|
|
|
config.profile_examples = 5
|
|
|
|
|
config.run_all_when_everything_filtered = true
|
|
|
|
|
# config.warnings = true
|
|
|
|
|
|
2020-11-30 05:57:26 +00:00
|
|
|
config.include( MDBX::Testing )
|
2020-11-19 02:06:45 +00:00
|
|
|
# config.include( Loggability::SpecHelpers )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|