<commit_before>'use strict';

var assert = require('assert');

var Config = require('../../lib/Config');

describe('Config', function() {
  describe('()', function() {
    it('should work with no options supplied', function(done) {
      var config = new Config();
      assert(config instanceof Config);
      done();
    });

    it('should not require the $HOME environment variable to be set', function(done) {
      var home = process.env.HOME;

      if (home) {
        delete process.env.HOME;
      }

      var config = new Config();
      assert(config instanceof Config);

      process.env.HOME = home;
      done();
    });

    it('should generate the appropriate apikey options when environment variables are supplied', function(done) {
      var oldApiKeyId = process.env.STORMPATH_CLIENT_APIKEY_ID;
      var oldApiKeySecret = process.env.STORMPATH_CLIENT_APIKEY_SECRET;

      process.env.STORMPATH_CLIENT_APIKEY_ID = 'xxx';
      process.env.STORMPATH_CLIENT_APIKEY_SECRET = 'yyy';

      var config = new Config();
      assert.equal(config.client.apiKey.id, 'xxx');
      assert.equal(config.client.apiKey.secret, 'yyy');

      process.env.STORMPATH_CLIENT_APIKEY_ID = oldApiKeyId;
      process.env.STORMPATH_CLIENT_APIKEY_SECRET = oldApiKeySecret;

      done();
    });

    it('should generate the appropriate application options when environment variables are supplied', function(done) {
      var oldApplicationHref = process.env.STORMPATH_APPLICATION_HREF;
      var oldApplicationName = process.env.STORMPATH_APPLICATION_NAME;

      process.env.STORMPATH_APPLICATION_HREF = 'xxx';
      process.env.STORMPATH_APPLICATION_NAME = 'yyy';

      var config = new Config();
      assert.equal(config.application.href, 'xxx');
      assert.equal(config.application.name, 'yyy');

      process.env.STORMPATH_APPLICATION_HREF = oldApplicationHref;
      process.env.STORMPATH_APPLICATION_NAME = oldApplicationName;

      done();
    });
  });
});
<commit_msg>Updating tests.<commit_after>'use strict';

var assert = require('assert');

var Config = require('../../lib/Config');

describe('Config', function() {
  describe('()', function() {
    it('should work with no options supplied', function(done) {
      var config = new Config();
      assert(config instanceof Config);
      done();
    });

    it('should not require the $HOME environment variable to be set', function(done) {
      var home = process.env.HOME;

      if (home) {
        delete process.env.HOME;
      }

      var config = new Config();
      assert(config instanceof Config);

      process.env.HOME = home;
      done();
    });

    it('should generate the appropriate apikey options when environment variables are supplied', function(done) {
      var oldApiKeyId = process.env.STORMPATH_CLIENT_APIKEY_ID;
      var oldApiKeySecret = process.env.STORMPATH_CLIENT_APIKEY_SECRET;

      process.env.STORMPATH_CLIENT_APIKEY_ID = 'xxx';
      process.env.STORMPATH_CLIENT_APIKEY_SECRET = 'yyy';

      var config = new Config();
      assert.equal(config.client.apiKey.id, 'xxx');
      assert.equal(config.client.apiKey.secret, 'yyy');

      process.env.STORMPATH_CLIENT_APIKEY_ID = oldApiKeyId;
      process.env.STORMPATH_CLIENT_APIKEY_SECRET = oldApiKeySecret;

      done();
    });

    it('should generate the appropriate application options when environment variables are supplied', function(done) {
      process.env.STORMPATH_APPLICATION_HREF = 'xxx';
      process.env.STORMPATH_APPLICATION_NAME = 'yyy';

      var config = new Config();
      assert.equal(config.application.href, 'xxx');
      assert.equal(config.application.name, 'yyy');

      delete process.env.STORMPATH_APPLICATION_HREF;
      delete process.env.STORMPATH_APPLICATION_NAME;

      done();
    });
  });
});

{'fraction_non_alphanumeric': 0.11917916337805841, 'fraction_numerical': 0.0, 'mean_word_length': 3.3302961275626424, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '313054', 'n_tokens_mistral': 1169, 'n_tokens_neox': 1141, 'n_words': 245}