Sha256: ab026de322e9202a14cbb6f6fa2a1a09d460f7a4b46a8c90d5ebc957aa398b5f

Contents?: true

Size: 652 Bytes

Versions: 9

Compression:

Stored size: 652 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))

describe "Publisher", "publish" do
  
  it "should send data to the dashboard server" do
    Dboard::Api::Client.should_receive(:post).with("/sources/new_relic", :body => { :data => { :db => "80%" }.to_json }, :timeout => 10000)
    Dboard::Publisher.publish(:new_relic, { :db => "80%" })
  end

  it "should handle and log socket errors" do
    Dboard::Api::Client.should_receive(:post).and_raise(SocketError.new("failed to connect"))
    Dboard::Publisher.should_receive(:puts).with("SocketError: failed to connect")
    Dboard::Publisher.publish(:new_relic, {})
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
dboard-1.1.0 spec/publisher_spec.rb
dboard-1.0.5 spec/publisher_spec.rb
dboard-1.0.4 spec/publisher_spec.rb
dboard-1.0.3 spec/publisher_spec.rb
dboard-1.0.2 spec/publisher_spec.rb
dboard-1.0.1 spec/publisher_spec.rb
dboard-1.0.0 spec/publisher_spec.rb
dboard-0.0.5 spec/publisher_spec.rb
dboard-0.0.4 spec/publisher_spec.rb