-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathspec_helper.rb
47 lines (35 loc) · 1.06 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
39
40
41
42
43
44
45
46
47
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
config.filter_run :focus
config.run_all_when_everything_filtered = true
config.disable_monkey_patching!
# config.warnings = true
if config.files_to_run.one?
config.default_formatter = 'doc'
end
# config.profile_examples = 10
config.order = :random
Kernel.srand config.seed
config.before do
%w(write read).each do |meth|
allow(IO).to receive(meth) do |*args|
fail "stub me: IO.#{meth}(#{args.map(&:inspect) * ', '})"
end
end
%w(mkdir mkpath).each do |meth|
allow(FileUtils).to receive(meth) do |*args|
fail "stub me: FileUtils.#{meth}(#{args.map(&:inspect) * ', '})"
end
end
%w(` system).each do |meth|
allow(Kernel).to receive(meth) do |*args|
fail "stub me: Kernel.#{meth}(#{args.map(&:inspect) * ', '})"
end
end
end
end