Skip to content

Commit

Permalink
added specs for running check in sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
auxesis committed Jun 30, 2009
1 parent d42c152 commit 4936aba
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions spec/worker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
end

it "should perform a check" do
sandbox = File.expand_path(File.join(File.dirname(__FILE__), 'check_sandbox'))
w = Flapjack::Worker.new(:host => 'localhost',
:port => 11300,
:logger => MockLogger.new)
# if this fails your machine is truly fucked
:logger => MockLogger.new,
:check_directory => sandbox)
# calls check spec/check_sandbox/echo
output, retval = w.perform_check('echo foo')
output.should =~ /foo/
retval.should == 0
Expand Down Expand Up @@ -98,6 +100,18 @@
w.report_check(:result => "foo", :retval => retval, :check => check)
end

it "should run a check in a sandbox" do
sandbox = File.expand_path(File.join(File.dirname(__FILE__), 'check_sandbox'))
w = Flapjack::Worker.new(:host => 'localhost',
:port => 11300,
:logger => MockLogger.new,
:check_directory => sandbox)

output, retval = w.perform_check('sandboxed_check')
output.should =~ /#{sandbox}/
retval.should == 0
end

end


Expand Down

0 comments on commit 4936aba

Please sign in to comment.