/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var tape = require( 'tape' );
var RuleTester = require( 'eslint' ).RuleTester;
var rule = require( './../lib' );


// FIXTURES //

var valid = require( './fixtures/valid.js' );
var invalid = require( './fixtures/invalid.js' );
var unvalidated = require( './fixtures/unvalidated.js' );


// TESTS //

tape( 'main export is an object', function test( t ) {
	t.ok( true, __filename );
	t.equal( typeof rule, 'object', 'main export is an object' );
	t.end();
});

tape( 'the function positively validates code with JSDoc comments that do not contain Markdown lint errors', function test( t ) {
	var tester = new RuleTester();

	try {
		tester.run( 'jsdoc-linebreak-style', rule, {
			'valid': valid,
			'invalid': []
		});
		t.pass( 'passed without errors' );
	} catch ( err ) {
		t.fail( 'encountered an error: ' + err.message );
	}
	t.end();
});

tape( 'the function negatively validates code with JSDoc comments that contain Markdown lint errors', function test( t ) {
	var tester = new RuleTester();

	try {
		tester.run( 'jsdoc-linebreak-style', rule, {
			'valid': [],
			'invalid': invalid
		});
		t.pass( 'passed without errors' );
	} catch ( err ) {
		t.fail( 'encountered an error: ' + err.message );
	}
	t.end();
});

tape( 'the function does not validate non-JSDoc comments', function test( t ) {
	var tester = new RuleTester();

	try {
		tester.run( 'jsdoc-linebreak-style', rule, {
			'valid': unvalidated,
			'invalid': []
		});
		t.pass( 'passed without errors' );
	} catch ( err ) {
		t.fail( 'encountered an error: ' + err.message );
	}
	t.end();
});

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var tape = require( 'tape' );
var RuleTester = require( 'eslint' ).RuleTester;
var rule = require( './../lib' );


// FIXTURES //

var valid = require( './fixtures/valid.js' );
var invalid = require( './fixtures/invalid.js' );
var unvalidated = require( './fixtures/unvalidated.js' );


// TESTS //

tape( 'main export is an object', function test( t ) {
	t.ok( true, __filename );
	t.equal( typeof rule, 'object', 'main export is an object' );
	t.end();
});

tape( 'the function positively validates code with JSDoc comments that do not contain lint errors', function test( t ) {
	var tester = new RuleTester();

	try {
		tester.run( 'jsdoc-linebreak-style', rule, {
			'valid': valid,
			'invalid': []
		});
		t.pass( 'passed without errors' );
	} catch ( err ) {
		t.fail( 'encountered an error: ' + err.message );
	}
	t.end();
});

tape( 'the function negatively validates code with JSDoc comments that contain lint errors', function test( t ) {
	var tester = new RuleTester();

	try {
		tester.run( 'jsdoc-linebreak-style', rule, {
			'valid': [],
			'invalid': invalid
		});
		t.pass( 'passed without errors' );
	} catch ( err ) {
		t.fail( 'encountered an error: ' + err.message );
	}
	t.end();
});

tape( 'the function does not validate non-JSDoc comments', function test( t ) {
	var tester = new RuleTester();

	try {
		tester.run( 'jsdoc-linebreak-style', rule, {
			'valid': unvalidated,
			'invalid': []
		});
		t.pass( 'passed without errors' );
	} catch ( err ) {
		t.fail( 'encountered an error: ' + err.message );
	}
	t.end();
});

Update test descriptions