Skip to content

enable! method needed for conditionally enabling l2meter output in tests #4

Open
@mathias

Description

If I do the recommended:

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?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions