I am trying to write server spec code for some service. I want to add the timeout so that if within given time, command doesn't responds, the test case should fail.
When tried for timeout(0), test was passing. Does this mean that there is no timeout?
Code:
Timeout.timeout(0) do
describe 'Check' do
describe command('echo xxxx | nc localhost xxxx') do
its(:stdout) { should contain('xxxx') }
its(:stderr) { should match '' }
end
end
end
Generally timeout(0) or timeout(-1) will indicate that there is no timeout. Is it same with serverspec also. Please help.
From
Timeoutdocs:Emphasis is mine.