Skip to content

Commit 982733f

Browse files
committed
Bring spec config in line with defaults
1 parent b1ffe94 commit 982733f

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

spec/spec_helper.rb

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class Application < ::Rails::Application
1111
end
1212
end
1313
end
14+
1415
I18n.enforce_available_locales = true
1516

1617
require 'rspec/support/spec'
@@ -25,17 +26,34 @@ def self.run_all(reporter=nil)
2526
end
2627
end
2728

29+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
2830
RSpec.configure do |config|
31+
config.expect_with :rspec do |expectations|
32+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
33+
end
34+
35+
config.mock_with :rspec do |mocks|
36+
# mocks.verify_partial_doubles = true
37+
mocks.verify_doubled_constant_names = true
38+
end
39+
2940
config.filter_run :focus
3041
config.run_all_when_everything_filtered = true
42+
3143
config.order = :random
44+
Kernel.srand config.seed
45+
46+
config.shared_context_metadata_behavior = :apply_to_host_groups
47+
48+
config.disable_monkey_patching!
3249

33-
real_world = nil
34-
config.before(:each) do
50+
config.warnings = true
51+
config.raise_on_warning = true
52+
53+
config.around(:example) do |example|
3554
real_world = RSpec.world
3655
RSpec.instance_variable_set(:@world, RSpec::Core::World.new)
37-
end
38-
config.after(:each) do
56+
example.run
3957
RSpec.instance_variable_set(:@world, real_world)
4058
end
4159
end

0 commit comments

Comments
 (0)