forked from jscruggs/metric_fu
-
Notifications
You must be signed in to change notification settings - Fork 96
/
spec_helper.rb
46 lines (39 loc) · 1.19 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
# add lib to the load path just like rubygems does
$:.unshift File.expand_path("../../lib", __FILE__)
require "simplecov"
require "date"
require "test_construct"
require "json"
require "pry-nav"
require "metric_fu"
include MetricFu
def mf_log(msg); mf_debug(msg); end
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[MetricFu.root_dir + "/spec/support/**/*.rb"].each { |f| require f }
RSpec.configure do |config|
config.filter_run focus: true
config.run_all_when_everything_filtered = true
# Skip specs tagged `:slow` unless SLOW_SPECS is set
config.filter_run_excluding :slow unless ENV["SLOW_SPECS"]
# End specs on first failure if FAIL_FAST is set
config.fail_fast = ENV.include?("FAIL_FAST")
config.order = :rand
config.color = true
config.expect_with :rspec do |expectations|
expectations.syntax = :expect
end
config.mock_with :rspec do |mocks|
mocks.syntax = :expect
mocks.verify_partial_doubles = true
end
# :suite after/before all specs
# :each every describe block
# :all every it block
config.after(:suite) do
cleanup_fs
end
config.append_after do
MetricFu.reset
end
end