{"size": 1246, "ext": "js", "max_stars_repo_path": "src/tests/util/resource.test.js", "max_stars_repo_name": "pbredenberg/dynamodb-capacity-manager", "max_stars_repo_stars_event_min_datetime": "2016-09-02T05:41:22.000Z", "max_stars_repo_stars_event_max_datetime": "2018-05-09T02:38:09.000Z", "max_issues_repo_path": "src/tests/util/resource.test.js", "max_issues_repo_name": "pbredenberg/dynamodb-capacity-manager", "max_issues_repo_issues_event_min_datetime": "2016-09-01T18:29:54.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-24T14:09:29.000Z", "max_forks_repo_path": "src/tests/util/resource.test.js", "max_forks_repo_name": "pbredenberg/dynamodb-capacity-manager", "max_forks_repo_forks_event_min_datetime": "2016-09-06T21:02:09.000Z", "max_forks_repo_forks_event_max_datetime": "2020-11-04T14:30:36.000Z"}
{"max_stars_count": 5, "max_issues_count": 29, "max_forks_count": 3, "avg_line_length": 42.9655172414, "max_line_length": 120, "alphanum_fraction": 0.6548956661}
'use strict';

var expect = require('expect.js'),
    resourceUtils = require('../../util/resource');

describe('Resource Utils', function() {

   describe('Resource name assembly', function() {

      it('should correctly return table names', function() {
         expect(resourceUtils.makeResourceName('')).to.be('');
         expect(resourceUtils.makeResourceName('table-name')).to.be('table-name');
         expect(resourceUtils.makeResourceName('other-table')).to.be('other-table');
         expect(resourceUtils.makeResourceName('table-name', false)).to.be('table-name');
         expect(resourceUtils.makeResourceName('table-name', undefined)).to.be('table-name');
         expect(resourceUtils.makeResourceName('table-name', '')).to.be('table-name');
      });

      it('should correctly return index names', function() {
         expect(resourceUtils.makeResourceName('', '')).to.be('');
         expect(resourceUtils.makeResourceName('table-name', 'my-index')).to.be('table-name::my-index');
         expect(resourceUtils.makeResourceName('other-table', 'different-index')).to.be('other-table::different-index');
         expect(resourceUtils.makeResourceName('', 'different-index')).to.be('::different-index');
      });

   });

});
