Skip to content

Commit

Permalink
Added test for non markdown files
Browse files Browse the repository at this point in the history
  • Loading branch information
opensoars committed Nov 26, 2014
1 parent 2dc8587 commit 0adffcb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
19 changes: 1 addition & 18 deletions test/mocha/getMarkdownFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,7 @@ var base_dir = __dirname + '/../..',


process.LIB = lib_dir;
//process.MSGS = require(lib_dir + 'msgs.js');

process.MSGS = {
could_not_read_md_dir: 'Could not read this directory: ',
empty_dir:'There are no files in this directory',
file_not_specified:
'No markdown file specified, will try to find any markdown file now',
file_specified: 'Markdown file specified',
check_exists: 'Checking if the specified file exists',
does_not_exists: 'The following file does not exist: ',
no_md_files: 'No markdown files to use, will exit now',
files_used: 'The following markdown file(s) will be used: ',
bad_tags: 'The required tags are not present (details below) in file: ',
no_table_re: 'Could not find the table of contents in file: ',
no_content_re: 'Could not find the content in file: ',
processed_file_err: 'Could not write processed_file because '
};

process.MSGS = require(lib_dir + 'msgs.js');

process.logErr = function (){};
process.log = function (){};
Expand Down
4 changes: 4 additions & 0 deletions test/mocha/isMarkdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ describe('#isMarkdown', function (){
assert.equal(isMarkdown('test.markdown'), true);
});

it('returns false if we test a file without a markdown extension', function (){
assert.equal(isMarkdown('test.not_md'), false);
});

it("doesn't throw when the regex pattern can't find any form of file extension", function (){
assert.doesNotThrow(function (){
isMarkdown('test');
Expand Down

0 comments on commit 0adffcb

Please sign in to comment.