test/helper.rb in fluent-plugin-flowcounter-1.0.0 vs test/helper.rb in fluent-plugin-flowcounter-1.1.0

- old
+ new

@@ -15,5 +15,15 @@ require 'fluent/test/driver/output' require 'fluent/plugin/out_flowcounter' class Test::Unit::TestCase end + +def waiting(seconds) + begin + Timeout.timeout(seconds) do + yield + end + rescue Timeout::Error + raise "Timed out with timeout second #{seconds}" + end +end