Sha256: 9112fca788c1be2d1fed536e97228a327b116356e2eeaa766fa35c970c83adfa

Contents?: true

Size: 856 Bytes

Versions: 13

Compression:

Stored size: 856 Bytes

Contents

require 'test_helper'
require 'circuitbox/notifier'
require 'active_support/notifications'

describe Circuitbox::Notifier do
  it "[notify] sends an ActiveSupport::Notification" do
    ActiveSupport::Notifications.expects(:instrument).with("circuit_open", circuit: 'yammer:12')
    Circuitbox::Notifier.new(:yammer, 12).notify(:open)
  end

  it "[notify_warning] sends an ActiveSupport::Notification" do
    ActiveSupport::Notifications.expects(:instrument).with("circuit_warning", { circuit: 'yammer:12', message: 'hello'})
    Circuitbox::Notifier.new(:yammer, 12).notify_warning('hello')
  end

  it '[gauge] sends an ActiveSupport::Notifier' do
    ActiveSupport::Notifications.expects(:instrument).with("circuit_gauge", { circuit: 'yammer:12', gauge: 'ratio', value: 12})
    Circuitbox::Notifier.new(:yammer, 12).metric_gauge(:ratio, 12)

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
circuitbox-1.0.3 test/notifier_test.rb
circuitbox-1.0.2 test/notifier_test.rb
circuitbox-1.0.1 test/notifier_test.rb
circuitbox-1.0.0 test/notifier_test.rb
circuitbox-0.11.0 test/notifier_test.rb
circuitbox-0.10.4 test/notifier_test.rb
circuitbox-0.10.3 test/notifier_test.rb
circuitbox-0.10.2 test/notifier_test.rb
circuitbox-0.10.1 test/notifier_test.rb
circuitbox-0.10.0 test/notifier_test.rb
circuitbox-0.9.0 test/notifier_test.rb
circuitbox-0.8.0 test/notifier_test.rb
circuitbox-0.7.0 test/notifier_test.rb