use less ruby in tests

use less ruby in tests and hopefully eliminating last place where 'Errno::EBADF: Bad file descriptor' happened.

UT run locally