Skip to content

Commit f89bece

Browse files
committed
Merge pull request #99 from jdantonio/spec_helper
Added brute-force resets back to spec_helper to stabilize test suite.
2 parents 4fa3fba + 1415e6b commit f89bece

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

spec/spec_helper.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,14 @@
2828

2929
RSpec.configure do |config|
3030
config.order = 'random'
31+
32+
config.before(:each) do
33+
#TODO: Better configuration management in individual test suites
34+
reset_gem_configuration
35+
end
36+
37+
config.after(:each) do
38+
#TODO: Better thread management in individual test suites
39+
kill_rogue_threads(false)
40+
end
3141
end

spec/support/example_group_extensions.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def reset_gem_configuration
2626
Concurrent.instance_variable_set(:@configuration, Concurrent::Configuration.new)
2727
end
2828

29-
def kill_rogue_threads
30-
warn '[DEPRECATED] brute force thread control being used -- tests need updated'
29+
def kill_rogue_threads(warning = true)
30+
warn('[DEPRECATED] brute force thread control being used -- tests need updated') if warning
3131
Thread.list.each do |thread|
3232
thread.kill unless thread == Thread.current
3333
end

0 commit comments

Comments
 (0)