Sha256: 291de967efba31d40b81586cc9c7335a42c157e1251d39c3fb9c858fc2db9875

Contents?: true

Size: 1.04 KB

Versions: 4

Compression:

Stored size: 1.04 KB

Contents

require 'test_helper'

require 'outpost/scouts'

describe "using only report data integration test" do
  class RetrieveServerData < Outpost::Application
    using Outpost::Scouts::Http => 'master http server' do
      options :host => 'localhost', :port => 9595, :path => '/'
    end

    using Outpost::Scouts::Ping => :load_balancer do
      options :host => 'localhost'
      report :up, :response_time => {:less_than => 500}
    end
  end

  before(:each) do
    @server = Server.new
    @server.boot(TestApp)
    @server.wait_until_booted

    @outpost = RetrieveServerData.new
    @outpost.run
  end

  it "should build report for each scout" do
    assert_equal 2, @outpost.reports.size
  end

  it "should build reports with data" do
    http_report = @outpost.reports['master http server']
    ping_report = @outpost.reports[:load_balancer]

    report_data = http_report.data

    assert report_data.delete(:response_time) < 500
    assert_equal({:response_code => 200,
                  :response_body => 'Up and running!'}, http_report.data)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
outpost-0.2.4 test/integration/reporting_test.rb
outpost-0.2.3 test/integration/reporting_test.rb
outpost-0.2.2 test/integration/reporting_test.rb
outpost-0.2.1 test/integration/reporting_test.rb