Commit d064d47
committed
Reset codec in syslog singleton to prevent mock leakage
The syslog singleton also stores @codec which can be mocked in tests.
Previously we only reset syslog but not codec, causing mock leakage
into other tests when the codec double was accessed.
Changes:
- Reset both syslog and codec in the after hook
- Add nil guard for codec in add_record method
- Prevents "double leaked into another example" errors1 parent 5e349d5 commit d064d47
2 files changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
| |||
0 commit comments