Sha256: f8d89fd5265996a1b71eedd2c2037689066996d21c27a060e85e27f147143e1c

Contents?: true

Size: 633 Bytes

Versions: 3

Compression:

Stored size: 633 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 })
    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

3 entries across 3 versions & 1 rubygems

Version Path
dboard-0.0.3 spec/publisher_spec.rb
dboard-0.0.2 spec/publisher_spec.rb
dboard-0.0.1 spec/publisher_spec.rb