File: timeout.rb

package info (click to toggle)
ruby-innertube 1.1.0-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 164 kB
  • sloc: ruby: 540; makefile: 3
file content (15 lines) | stat: -rw-r--r-- 317 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require 'timeout'

RSpec.configure do |config|
  config.include Timeout
  config.around(:each) do |example|
    time = example.metadata[:timeout] || 30
    begin
      timeout(time, Timeout::Error) do
        example.run
      end
    rescue Timeout::Error => e
      example.send :set_exception, e
    end
  end
end