def memcached_mock(prc, meth = :start, meth_args = [])
      return unless supports_fork?

      begin
        pid = fork_mock_process(prc, meth, meth_args)
        sleep 0.3 # Give time for the socket to start listening.
        yield
      ensure
        kill_process(pid)
      end
    end
Forks the current process and starts a new mock Memcached server on
port 22122.

memcached_mock(lambda {|sock| socket.write('123') }) do
assert_equal "PONG", Dalli::Client.new('localhost:22122').get('abc')
end