'use strict';

var expect = require('chai').expect;
var replier = require('../');


describe("", function(){
    replier
    .server()
    .on('');

    it("description", function(done){
        // code ...
    });

});
@@ -87,16 +87,31 @@
 scribe(%22
+replier.check()
 %22, funct
@@ -125,79 +125,1792 @@
     
-replier%0A    .server()%0A    .on('');%0A%0A    it(%22description%22, function(done
+it(%22with no server%22, function(done)%7B%0A        replier.check(9000, function (alive) %7B%0A            expect(alive).to.equal(false);%0A            done();%0A        %7D);%0A    %7D);%0A%0A    it(%22with a server%22, function(done)%7B%0A        var server = replier.server();%0A%0A        server.listen(9001, function () %7B%0A            replier.check(9001, function (alive) %7B%0A                expect(alive).to.equal(true);%0A                done();%0A            %7D);%0A        %7D);%0A    %7D);%0A%7D);%0A%0A%0Adescribe(%22basic usage%22, function()%7B%0A    it(%22callbacks should not be messed up.%22, function(done)%7B%0A        var port = 9002;%0A        var server = replier.server().on('message', function(msg, reply)%7B%0A            if(!msg)%7B%0A                return;%0A            %7D%0A            %0A            var result;%0A            var array = msg.array;%0A            var err = null;%0A            %0A            switch(msg.action)%7B%0A                case 'sum':%0A                    result = array.reduce(function(p, c)%7B%0A                        return p + c;%0A                    %7D);%0A%0A                    return setTimeout(function () %7B%0A                        reply(err, result);%0A                    %7D, 50);%0A%0A                    break;%0A                    %0A                case 'join':%0A                    result = array.join('');%0A                    break;%0A                    %0A                default:%0A                    err = 'error!'%0A            %7D%0A            %0A            reply(err, result);%0A%0A        %7D).listen(port);%0A%0A        var count = 2;%0A%0A        function cb () %7B%0A            count --;%0A            if ( !count ) %7B%0A                done();%0A            %7D%0A        %7D%0A%0A        var client = replier.client().connect(port, function(err)%7B%0A            client.send(%7B%0A                action: 'sum',%0A                array: %5B1, 2, 3%5D%0A            %7D, function(err, result
 )%7B%0A 
@@ -1920,28 +1920,405 @@
     
+  
-// code ...%0A    %7D);%0A
+      expect(err).to.equal(null);%0A                expect(result).to.equal(6);%0A                cb();%0A            %7D);%0A%0A            client.send(%7B%0A                action: 'join',%0A                array: %5B1, 2, 3%5D%0A            %7D, function(err, result)%7B%0A                expect(err).to.equal(null);%0A                expect(result).to.equal('123');%0A                cb();%0A            %7D);%0A        %7D);%0A    %7D);
 %0A%7D);

add test cases