nsca-client/spec/nsca/client/notifier_spec.rb

21 lines
619 B
Ruby
Raw Permalink Normal View History

2012-12-07 19:39:46 +01:00
require 'spec_helper'
describe NSCA::Client::Notifier do
let(:server) { NSCA::Client::RemoteServer.new(:host => '172.0.0.1') }
let(:host) { NSCA::Client::Host.new(:hostname => 'dummy') }
let(:service) { NSCA::Client::Service.new(:name => 'TestMessage', :host => host) }
let(:message) { NSCA::Client::Message.new(:ok, 'OK', service, server) }
context "send message successfully" do
before do
SendNsca::NscaConnection.any_instance.should_receive(:send_nsca)
end
let(:notifier) { NSCA::Client::Notifier.new(message) }
subject { notifier.send_nsca }
it { should be_true }
end
end