var path = require('path');
var ruleUtils = require('../../lib/rule_utils');
var testRule = require('../stylelint_rule_tester');

var stylelint = testRule.stylelint;

var rule = require('../../lib/lint_css_rules/' + path.basename(__filename));
var sub = require('string-sub');

var stylelintRule = require('stylelint/lib/rules/at-rule-empty-line-before');

var path = require('path');
var fs = require('fs');
var chai = require('chai');
var _ = require('lodash');

chai.use(require('chai-string'));

var assert = chai.assert;

testRule(
	rule,
	{
		ruleName: rule.ruleName,
		config: ['always', {except: ['first-nested']}],
		accept: [
			{
				code: 'a {\n  @include foo;\n  color: pink;\n}',
				description: 'always at rule empty line no first-nested'
			}
		],
		reject: [
			{
				code: 'a {\n color: blue;\n @include foo;\n}',
				message: stylelintRule.messages.expected
			}
		],
		syntax: 'scss',
	}
);

testRule(
	rule,
	{
		description: 'should handle invalid options',
		config: [],
		skipBasicChecks: true,
		reject: [
			{
				code: 'a {\n}',
				message: 'Expected option value for rule "' + rule.ruleName + '"'
			}
		],
	}
);
@@ -648,16 +648,18 @@
 de: 
-'a %7B%5Cn  
+%60a %7B%0A%09%09%09%09%09
 @inc
@@ -671,12 +671,14 @@
 foo;
-%5Cn  
+%0A%09%09%09%09%09
 colo
@@ -685,20 +685,23 @@
 r: pink;
-%5Cn%7D'
+%0A%09%09%09%09%7D%60
 ,%0A%09%09%09%09de
@@ -755,16 +755,215 @@
 nested'%0A
+%09%09%09%7D,%0A%09%09%09%7B%0A%09%09%09%09code: %60%0A%09%09%09%09%09@if $foo != null %7B%0A%09%09%09%09%09%09div %7B%0A%09%09%09%09%09%09%09color: blue;%0A%09%09%09%09%09%09%7D%0A%09%09%09%09%09%7D%0A%09%09%09%09%09@else %7B%0A%09%09%09%09%09%09div %7B%0A%09%09%09%09%09%09%09color: red;%0A%09%09%09%09%09%09%7D%0A%09%09%09%09%09%7D%0A%09%09%09%09%60,%0A%09%09%09%09description: 'ignore @else blocks'%0A
 %09%09%09%7D%0A%09%09%5D
@@ -995,15 +995,18 @@
 de: 
-'a %7B%5Cn 
+%60a %7B%0A%09%09%09%09%09
 colo
@@ -1017,11 +1017,14 @@
 lue;
-%5Cn 
+%0A%09%09%09%09%09
 @inc
@@ -1032,20 +1032,23 @@
 ude foo;
-%5Cn%7D'
+%0A%09%09%09%09%7D%60
 ,%0A%09%09%09%09me

Update test coverage for scss rule