enable! method needed for conditionally enabling l2meter output in tests
- Dominant language
- Ruby
- Stars
- 4
- Forks
- 2
- Avg merge
- 18h 57m
- Merged PRs (30d)
- 1
Description
If I do the recommended:
```ruby
RSpec.configure do |config|
config.around :each do |example|
Metrics.silence &example
end
end
```
I'd also like to test in particular contexts that the Librato metrics I expected are being output. A simple way to do this would be a new method like `disable!` called `enable!` that would allow me to enable L2meter (un-silence it) for just one context in RSpec. It feels like it would be overkill to have to wrap all my other tests in `Metrics.silence` in each context just so that one or two tests can have it enabled.
I suppose another way to test this would be to check that L2Meter is receiving the message I am sending, but I'd rather test this at the logline level, since my tests are already at that level.
Thoughts?
Contributor guide
Assessment
This issue has not been assessed yet.