'use strict';

var lint = require('./_lint');

describe('mixin name format - scss', function () {
  var file = lint.file('mixin-name-format.scss');

  it('[convention: hyphenatedlowercase]', function (done) {
    lint.test(file, {
      'mixin-name-format': 1
    }, function (data) {
      lint.assert.equal(7, data.warningCount);
      done();
    });
  });

  it('[convention: camelcase]', function (done) {
    lint.test(file, {
      'mixin-name-format': [
        1,
        {
          'convention': 'camelcase'
        }
      ]
    }, function (data) {
      lint.assert.equal(8, data.warningCount);
      done();
    });
  });

  it('[convention: snakecase]', function (done) {
    lint.test(file, {
      'mixin-name-format': [
        1,
        {
          'convention': 'snakecase'
        }
      ]
    }, function (data) {
      lint.assert.equal(7, data.warningCount);
      done();
    });
  });

  it('[convention: RegExp ^[_A-Z]+$]', function (done) {
    lint.test(file, {
      'mixin-name-format': [
        1,
        {
          'convention': '^[_A-Z]+$',
          'convention-explanation': 'Its bad and you should feel bad.'
        }
      ]
    }, function (data) {
      lint.assert.equal(8, data.warningCount);
      done();
    });
  });

  it('[convention: allow-leading-underscore false]', function (done) {
    lint.test(file, {
      'mixin-name-format': [
        1,
        {
          'allow-leading-underscore': false
        }
      ]
    }, function (data) {
      lint.assert.equal(8, data.warningCount);
      done();
    });
  });
});

describe('mixin name format - sass', function () {
  var file = lint.file('mixin-name-format.sass');

  it('[convention: hyphenatedlowercase]', function (done) {
    lint.test(file, {
      'mixin-name-format': 1
    }, function (data) {
      lint.assert.equal(7, data.warningCount);
      done();
    });
  });

  it('[convention: camelcase]', function (done) {
    lint.test(file, {
      'mixin-name-format': [
        1,
        {
          'convention': 'camelcase'
        }
      ]
    }, function (data) {
      lint.assert.equal(8, data.warningCount);
      done();
    });
  });

  it('[convention: snakecase]', function (done) {
    lint.test(file, {
      'mixin-name-format': [
        1,
        {
          'convention': 'snakecase'
        }
      ]
    }, function (data) {
      lint.assert.equal(7, data.warningCount);
      done();
    });
  });

  it('[convention: RegExp /^[_A-Z]+$/]', function (done) {
    lint.test(file, {
      'mixin-name-format': [
        1,
        {
          'convention': /^[_A-Z]+$/,
          'convention-explanation': 'Its bad and you should feel bad.'
        }
      ]
    }, function (data) {
      lint.assert.equal(8, data.warningCount);
      done();
    });
  });

  it('[convention: allow-leading-underscore false]', function (done) {
    lint.test(file, {
      'mixin-name-format': [
        1,
        {
          'allow-leading-underscore': false
        }
      ]
    }, function (data) {
      lint.assert.equal(8, data.warningCount);
      done();
    });
  });
});

@@ -2468,17 +2468,16 @@
  RegExp 
-/
 %5E%5B_A-Z%5D+
@@ -2477,17 +2477,16 @@
 %5B_A-Z%5D+$
-/
 %5D', func
@@ -2595,17 +2595,17 @@
 ntion': 
-/
+'
 %5E%5B_A-Z%5D+
@@ -2605,17 +2605,17 @@
 %5B_A-Z%5D+$
-/
+'
 ,%0A      

Fix sass test case