Module: Maxitest::Timeout
- Defined in:
- lib/maxitest/timeout.rb
Defined Under Namespace
Classes: TestCaseTimeout
Instance Method Summary collapse
Instance Method Details
#capture_exceptions(&block) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/maxitest/timeout.rb', line 16 def capture_exceptions(*, &block) if Maxitest.timeout == false super else super do rescued = false begin ::Timeout.timeout(Maxitest.timeout || 5, TestCaseTimeout, &block) rescue TestCaseTimeout => e raise e if rescued rescued = true retry end end end end |