ruby-mdbx/spec/lib/helper.rb
mahlon@martini.nu c0cd35e260 Multiple changes.
- Complete first round of documentation.
  - Complete first round of tests and coverage.
  - Expand the thread benchmarker for testing metasync.
  - Add enumerators (each_key/each_value/each_pair) using cursors.
  - Remove keys() implementation in favor of using the emumerable.
  - Make deserialization more DRY.
  - Add an efficient length() method.
  - Add various Hash-alike methods.
  - General code cleanup for release.

FossilOrigin-Name: 0d2bd3995f203c9ac1734ac3da32dd2f09efda9a394e554e6006e44dd07a33b0
2021-03-14 23:19:41 +00:00

59 lines
1.3 KiB
Ruby

# -*- ruby -*-
# vim: set noet sta sw=4 ts=4 :
# frozen_string_literal: true
if ENV[ 'COVERAGE' ]
require 'simplecov'
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
end
require 'pathname'
require 'rspec'
require 'json'
require 'mdbx'
module MDBX::Testing
TEST_DATABASE = Pathname( __FILE__ ).parent.parent.parent + 'tmp' + 'testdb'
end
RSpec.configure do |config|
include MDBX::Testing
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
config.include( MDBX::Testing )
# config.include( Loggability::SpecHelpers )
end