File: spec_helper.rb

package info (click to toggle)
ruby-countries 8.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,268 kB
  • sloc: ruby: 2,687; makefile: 4
file content (29 lines) | stat: -rw-r--r-- 729 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

require 'countries'
require 'debug'
require 'simplecov'
SimpleCov.start

RSpec.configure do |config|
  config.filter_run :focus
  config.run_all_when_everything_filtered = true
  config.filter_run_excluding perf: true
  config.example_status_persistence_file_path = 'spec/examples.txt'

  config.warnings = true

  config.default_formatter = 'doc' if config.files_to_run.one?
  # config.order = :random
  Kernel.srand config.seed

  config.register_ordering :global do |examples|
    defined, other = examples.partition do |example|
      example.metadata[:custom_order] == :first
    end

    randomized = RSpec::Core::Ordering::Random.new(config).order(other)

    defined + randomized
  end
end