Sha256: 07fd3c758997c1bca6a669190c686058747339f68e158b6d769023ca21463cec
Contents?: true
Size: 728 Bytes
Versions: 4
Compression:
Stored size: 728 Bytes
Contents
require 'rest-core/test' describe RC::Timeout do app = RC::Timeout.new(RC::Dry.new, 0) after do WebMock.reset! Muack.verify end would 'bypass timeout if timeout is 0' do mock(app).monitor.times(0) app.call({}){ |e| e.should.eq({}) } end would 'run the monitor to setup timeout' do env = {'timeout' => 2} mock(app).monitor(env) app.call(env){|e| e[RC::TIMER].should.kind_of?(RC::Timer)} end would "not raise timeout error if there's already an error" do env = {'timeout' => 0.01} mock(app.app).call(hash_including(env)){ raise "error" } lambda{ app.call(env){} }.should .raise(RuntimeError) lambda{ sleep 0.01 }.should.not.raise(Timeout::Error) end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
rest-core-3.3.3 | test/test_timeout.rb |
rest-core-3.3.2 | test/test_timeout.rb |
rest-core-3.3.1 | test/test_timeout.rb |
rest-core-3.3.0 | test/test_timeout.rb |