From f5a8e36e50c314db36afe08ab7c3196d5aa83aa6 Mon Sep 17 00:00:00 2001 From: devlinjd Date: Sat, 12 Dec 2015 11:13:37 -0500 Subject: [PATCH] Refactor theme tests. --- tests/test-themes.js | 100 +++++++++---------------------------------- 1 file changed, 21 insertions(+), 79 deletions(-) diff --git a/tests/test-themes.js b/tests/test-themes.js index d01b487..c224eda 100644 --- a/tests/test-themes.js +++ b/tests/test-themes.js @@ -26,85 +26,27 @@ describe('Testing themes', function () { useful: 'green', }); - it('HELLO-WORLD theme should generate without throwing an exception', function () { - function tryOpen() { - var src = ['node_modules/FRESCA/exemplar/jane-doe.json']; - var dst = ['tests/sandbox/hello-world/resume.all']; - var opts = { - theme: 'hello-world', - format: 'FRESH', - prettify: true, - silent: false - }; - FCMD.verbs.build( src, dst, opts ); - } - tryOpen.should.not.Throw(); - }); + function genTheme( themeName ) { + it( themeName.toUpperCase() + ' theme should generate without throwing an exception', function () { + function tryOpen() { + var src = ['node_modules/FRESCA/exemplar/jane-doe.json']; + var dst = ['tests/sandbox/hello-world/resume.all']; + var opts = { + theme: themeName, + format: 'FRESH', + prettify: true, + silent: false + }; + FCMD.verbs.build( src, dst, opts ); + } + tryOpen.should.not.Throw(); + }); + } - it('COMPACT theme should generate without throwing an exception', function () { - function tryOpen() { - var src = ['node_modules/FRESCA/exemplar/jane-doe.json']; - var dst = ['tests/sandbox/compact/resume.all']; - var opts = { - theme: 'compact', - format: 'FRESH', - prettify: true, - silent: false - }; - FCMD.verbs.build( src, dst, opts ); - } - tryOpen.should.not.Throw(); - }); - - it('MODERN theme should generate without throwing an exception', function () { - function tryOpen() { - var src = ['node_modules/FRESCA/exemplar/jane-doe.json']; - var dst = ['tests/sandbox/modern/resume.all']; - var opts = { - theme: 'modern', - format: 'FRESH', - prettify: true, - silent: false - }; - FCMD.verbs.build( src, dst, opts ); - } - tryOpen.should.not.Throw(); - }); - - it('MINIMIST theme should generate without throwing an exception', function () { - function tryOpen() { - var src = ['node_modules/FRESCA/exemplar/jane-doe.json']; - var dst = ['tests/sandbox/minimist/resume.all']; - var opts = { - theme: 'minimist', - format: 'FRESH', - prettify: true, - silent: false - }; - FCMD.verbs.build( src, dst, opts ); - } - tryOpen.should.not.Throw(); - }); - - it('AWESOME theme should generate without throwing an exception', function () { - function tryOpen() { - var src = ['node_modules/FRESCA/exemplar/jane-doe.json']; - var dst = ['tests/sandbox/awesome/resume.all']; - var opts = { - theme: 'awesome', - format: 'FRESH', - prettify: true, - silent: false - }; - FCMD.verbs.build( src, dst, opts ); - } - tryOpen.should.not.Throw(); - }); + genTheme('hello-world'); + genTheme('compact'); + genTheme('modern'); + genTheme('minimist'); + genTheme('awesome'); }); - -// describe('subtract', function () { -// it('should return -1 when passed the params (1, 2)', function () { -// expect(math.subtract(1, 2)).to.equal(-1); -// }); -// });