File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
spec/mspec/lib/mspec/runner/actions Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ def initialize
36
36
@thread_info = find_threads
37
37
@env_info = find_env
38
38
@argv_info = find_argv
39
+ @globals_info = find_globals
39
40
@encoding_info = find_encodings
40
41
end
41
42
@@ -48,9 +49,10 @@ def check(state)
48
49
check_process_leak
49
50
check_env
50
51
check_argv
52
+ check_globals
51
53
check_encodings
52
54
check_tracepoints
53
- GC . start if ! @leaks . empty?
55
+ GC . start unless @leaks . empty?
54
56
@leaks . empty?
55
57
end
56
58
@@ -244,6 +246,19 @@ def check_argv
244
246
end
245
247
end
246
248
249
+ def find_globals
250
+ { verbose : $VERBOSE, debug : $DEBUG }
251
+ end
252
+
253
+ def check_globals
254
+ old_globals = @globals_info
255
+ new_globals = find_globals
256
+ if new_globals != old_globals
257
+ leak "Globals changed: #{ old_globals . inspect } to #{ new_globals . inspect } "
258
+ @globals_info = new_globals
259
+ end
260
+ end
261
+
247
262
def find_encodings
248
263
[ Encoding . default_internal , Encoding . default_external ]
249
264
end
You can’t perform that action at this time.
0 commit comments