-
Notifications
You must be signed in to change notification settings - Fork 14
/
spec_helper.rb
38 lines (31 loc) · 1.17 KB
/
spec_helper.rb
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
30
31
32
33
34
35
36
37
38
# frozen_string_literal: true
require 'rubocop/cop/i18n'
require 'rubocop/rspec/cop_helper'
require 'shared_examples'
require 'shared_functions'
RSpec.configure do |config|
# These two settings work together to allow you to limit a spec run
# to individual examples or groups you care about by tagging them with
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
# get run.
unless defined?(TestQueue)
# See. https://github.com/tmm1/test-queue/issues/60#issuecomment-281948929
config.filter_run :focus
config.run_all_when_everything_filtered = true
end
config.example_status_persistence_file_path = 'spec/examples.txt'
config.order = :random
Kernel.srand config.seed
broken_filter = lambda do |v|
v.is_a?(Symbol) ? v.to_s == RUBY_ENGINE : v
end
config.filter_run_excluding broken: broken_filter
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
expectations.syntax = :expect # Disable `should`
end
config.mock_with :rspec do |mocks|
mocks.syntax = :expect # Disable `should_receive` and `stub`
mocks.verify_partial_doubles = true
end
end