Kentaro Kuribayashi's blog

Software Engineering, Management, Books, and Daily Journal.

Glint: Fires arbitrary TCP server processs for tests

id:tokuhirom's Test::TCP is very useful to test code against real arbitrary TCP server processes. I've wanted it for Ruby for long time. Now I started feeling I really need it, I ported it to Ruby.

server = do |port|
  # Execute target server process
  exec command, args

# Test your code against the server process
client ='', server.port)

# The process executed above will be shutdown here.

This library supports only server execution so far different from the orignal Perl module. I'm wondering whether I should add utility method and support for client dispatching or not.