Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

azuki-trusty / azk   deb

Repository URL to install this package:

Version: 0.5.1 

/ usr / lib / azk / node_modules / hipache / test / unit / driver-memcached.js

(function () {
    /*globals describe:false, before:false, after:false*/
    'use strict';

    var npmlog = require('npmlog');

    if (process.env.NO_MEMCACHED) {
        npmlog.error('Test', 'No memcached server on this machine! No tests, then.');
        return;
    }

    // Useful if you want to see servers talk to you
    // require('npmlog').level = 'silly';

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

    var Driver = require('../../lib/drivers/memcached');
    var Server = require('../fixtures/servers/memcached');
    var testReading = require('./driver-test-reading');

    var s1 = new Server();
    var s2 = new Server();

    // Start all servers beforehand
    before(function (done) {
        // XXX memcache doesn't output anything on stdout
        s1.start(['9001']);//, '-vv']);
        s2.start(['9002']);//, '-vv']);
        setTimeout(done, 1000);
    });

    // Shutdown pips!
    after(function (done) {
        s1.stop();
        s2.stop();
        setTimeout(done, 1000);
    });

    describe('Memcached', function () {

        [
        // Simple
            ['memcached://:9001'],
        // Use prefixes
            ['memcached://:9001/#someprefix'],
        // Cluster
            ['memcached://:9001/#prefix', 'memcached://:9002/#prefix']
        ].forEach(function (setup) {
            describe(setup, function () {
                testReading(Driver, setup);
            });
        });
    });

})();