Skip to content

Instantly share code, notes, and snippets.

@narath
Created November 28, 2023 18:00
Show Gist options
  • Save narath/4d23ed6d7a3f757901dece4cf6ec8dd3 to your computer and use it in GitHub Desktop.
Save narath/4d23ed6d7a3f757901dece4cf6ec8dd3 to your computer and use it in GitHub Desktop.
Simple Mock for Honeybadger.notify in Rails test
test "something" do
notified = false
Honeybadger.stub :notify, Proc.new { |s| notified = true } do
something_that_causes_honeybadger_notify_to_be_used
end
assert notified, "Honeybadger was not notified"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment