basecamp / easymon

Easy Monitoring
MIT License
205 stars 16 forks source link

Support using Easymon::Testing methods directly or by mixin #13

Closed packagethief closed 9 years ago

packagethief commented 9 years ago

This branch makes the Easymon::Testing helper easier to use. It changes from a class to a module, and uses the extend self pattern to make its methods accessible either directly or by way of mixing in.

Call methods directly on the module:

Easymon::Testing.stub_check(:redis)

Or mix into your tests for less typing:

class MyTest < Minitest::Test
  include Easymon::Testing

  def test_something
    stub_check(:redis)
    # ...
  end
end