mirror of
https://github.com/teampoltergeist/poltergeist.git
synced 2022-11-09 12:05:00 -05:00
21 lines
657 B
Ruby
21 lines
657 B
Ruby
require 'spec_helper'
|
|
|
|
module Capybara::Poltergeist
|
|
describe ServerManager do
|
|
subject { ServerManager.instance }
|
|
|
|
it 'should operate a timeout for waiting for a message' do
|
|
Timeout.stub(:timeout).with(ServerManager.timeout).and_raise(Timeout::Error)
|
|
lambda { subject.send(2000, 'omg') }.should raise_error(TimeoutError)
|
|
end
|
|
|
|
it 'should include the message that was sent in the timeout exception' do
|
|
Timeout.stub(:timeout).with(ServerManager.timeout).and_raise(Timeout::Error)
|
|
begin
|
|
subject.send(2000, 'omg')
|
|
rescue TimeoutError => e
|
|
e.message.should include('omg')
|
|
end
|
|
end
|
|
end
|
|
end
|