summaryrefslogtreecommitdiff
path: root/spec/support/ruby_ext.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/ruby_ext.rb')
-rw-r--r--spec/support/ruby_ext.rb21
1 files changed, 0 insertions, 21 deletions
diff --git a/spec/support/ruby_ext.rb b/spec/support/ruby_ext.rb
deleted file mode 100644
index 809708b978..0000000000
--- a/spec/support/ruby_ext.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-class IO
- def read_available_bytes(chunk_size = 16_384, select_timeout = 0.02)
- buffer = []
-
- return "" if closed? || eof?
- # IO.select cannot be used here due to the fact that it
- # just does not work on windows
- loop do
- begin
- IO.select([self], nil, nil, select_timeout)
- break if eof? # stop raising :-(
- buffer << readpartial(chunk_size)
- rescue EOFError
- break
- end
- end
-
- buffer.join
- end
-end