<commit_before>var assert = require('assert'),
    redis = require('../index');

describe('heroku-redis-client', function() {
    it('should load locally', function() {
        var redisClient = redis.createClient();

        assert.ok(redisClient);
        assert.equal(redisClient.port, 6379);
        assert.equal(redisClient.host, "127.0.0.1");
        assert.ok(redis.redis);

        redisClient.quit();
    });

    it('should load when in heroku', function() {
        var currentREDISTOGO_URL = process.env.REDISTOGO_URL;
        process.env.REDISTOGO_URL = "redis://user:password@<EMAIL>.redist<EMAIL>:9332/";


        var redisClient = redis.createClient();
        redisClient.on('error', function (err) {
            assert.includes(err.toString(), 'invalid password');
            redisClient.quit();
        });

        assert.ok(redisClient);
        assert.equal(redisClient.port, 9332);
        assert.equal(redisClient.host, "chubb.redistogo.com");
        assert.equal(redisClient.auth_pass, "password");
        assert.ok(redis.redis);

        redisClient.quit();

        process.env.REDISTOGO_URL = currentREDISTOGO_URL;
    });
})<commit_msg>more tests<commit_after>var assert = require('assert'),
    redis = require('../index');

describe('heroku-redis-client', function() {
    it('should load locally', function(done) {
        var redisClient = redis.createClient();

        assert.ok(redisClient);
        assert.equal(redisClient.port, 6379);
        assert.equal(redisClient.host, "127.0.0.1");
        assert.ok(redis.redis);

        redisClient.quit();

        done();
    });

    it('should load when in heroku', function(done) {
        var currentREDISTOGO_URL = process.env.REDISTOGO_URL;
        process.env.REDISTOGO_URL = "redis://user:password@<EMAIL>.red<EMAIL>:9332/";


        var redisClient = redis.createClient();
        redisClient.on('error', function (err) {
            assert.ok(err.toString().indexOf('invalid password') != -1);
            redisClient.quit();
            done();
        });

        assert.ok(redisClient);
        assert.equal(redisClient.port, 9332);
        assert.equal(redisClient.host, "chubb.redistogo.com");
        assert.equal(redisClient.auth_pass, "password");
        assert.ok(redis.redis);

        process.env.REDISTOGO_URL = currentREDISTOGO_URL;
    });
})
{'fraction_non_alphanumeric': 0.1532258064516129, 'fraction_numerical': 0.015704584040747028, 'mean_word_length': 2.7235387045813586, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2522514', 'n_tokens_mistral': 789, 'n_tokens_neox': 745, 'n_words': 108}