var expect = require('chai').expect;
var sinon = require('sinon');
var sh = require('shelljs');
var path = require('path');
var basePath = path.resolve(__dirname, '..');
var helper = require('./generateEsLintResult');
var fs = require('fs-extra');
var pathToTestJson = path.resolve(__dirname, 'result.json');
var pathToIndex = path.resolve(__dirname, '..', 'index.js');
var input = [];
var result;
describe('support interface',function() {

  before(function() {
    input.push(helper.createDummyError());
  });

  describe('cmd',function() {
    it('as eslint formatter', function() {
      result = sh.exec('eslint --format ' + '\'' + pathToIndex + '\' ' + pathToIndex);
      expect(result.stdout).to.contain('##teamcity');
    });

    it('as standalone',function() {
      fs.writeJSONSync(pathToTestJson, input);
      result = sh.exec('cd ' + basePath + '; node ' + 'index.js ' + pathToTestJson);
      expect(result.stdout).to.contain('##teamcity');
      expect(result.stderr).to.equal('');

      sh.rm(pathToTestJson);
    });
  });

  it('requirejs',function() {
    result = require(pathToIndex)(input);
    expect(result).to.contain('##teamcity');
  });
});
@@ -1040,18 +1040,24 @@
  %7D);%0A%0A  
-it
+describe
 ('requir
@@ -1070,24 +1070,55 @@
 unction() %7B%0A
+    it('basic', function() %7B%0A  
     result =
@@ -1143,24 +1143,26 @@
 ex)(input);%0A
+  
     expect(r
@@ -1194,16 +1194,437 @@
 city');%0A
+    %7D);%0A%0A    it('with parameters', function() %7B%0A      var parameters = %7B%0A        errorCountName: 'EslintInspectionStatsE',%0A        warningCountName: 'EslintInspectionStatsW'%0A%0A      %7D;%0A      result = require(pathToIndex)(input, parameters);%0A      expect(result).to.contain('ESLint Violations');%0A      expect(result).to.contain('EslintInspectionStatsE');%0A      expect(result).to.contain('EslintInspectionStatsW');%0A    %7D);%0A%0A
   %7D);%0A%7D)

add test for parameters of text variables