Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 37 lines (28 sloc) 0.982 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
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
    @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
Something went wrong with that request. Please try again.