-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reports are now indexed by its name and return data
- Loading branch information
1 parent
f3d24ec
commit 926ecd3
Showing
4 changed files
with
55 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
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] | ||
|
||
assert_equal({:response_code => 200, | ||
:response_body => 'Up and running!'}, http_report.data) | ||
|
||
assert ping_report.data[:response_time] < 500 | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters