/*!
 * grunt-smaller
 * https://github.com/olihel/grunt-smaller.git
 *
 * Copyright (c) 2013 Oliver Hellebusch
 * Released under MIT license (https://raw.github.com/olihel/grunt-smaller/master/LICENSE-MIT)
 */

'use strict';

var fs = require('fs');

var TMP_FOLDER = 'tmp.smaller/';
var REQUEST_ZIP_FILE = TMP_FOLDER + 'request/smaller.zip';
var RESPONSE_ZIP_FILE = TMP_FOLDER + 'response/smaller.zip';
var MIN_CSS_FILE = TMP_FOLDER + 'dist/css/app-base64-min.css';

/*
  ======== A Handy Little Nodeunit Reference ========
  https://github.com/caolan/nodeunit

  Test methods:
    test.expect(numAssertions)
    test.done()
  Test assertions:
    test.ok(value, [message])
    test.equal(actual, expected, [message])
    test.notEqual(actual, expected, [message])
    test.deepEqual(actual, expected, [message])
    test.notDeepEqual(actual, expected, [message])
    test.strictEqual(actual, expected, [message])
    test.notStrictEqual(actual, expected, [message])
    test.throws(block, [error], [message])
    test.doesNotThrow(block, [error], [message])
    test.ifError(value)
*/

exports.smaller = {
  setUp: function (done) {
    done();
  },
  checkRequestZipFile: function (test) {
    test.expect(1);
    test.ok(fs.existsSync(REQUEST_ZIP_FILE), 'request zip file exists');
    test.done();
  },
  checkResponseZipFile: function (test) {
    test.expect(1);
    test.ok(fs.existsSync(RESPONSE_ZIP_FILE), 'response zip file exists');
    test.done();
  },
  checkMinifiedFiles: function (test) {
    test.expect(1);
    test.ok(fs.existsSync(MIN_CSS_FILE), 'minified files exist');
    test.done();
  }
};

@@ -208,23 +208,8 @@
 */%0A%0A
-'use strict';%0A%0A
 var 
@@ -378,24 +378,77 @@
 aller.zip';%0A
+var MIN_JS_FILE = TMP_FOLDER + 'dist/js/app-min.js';%0A
 var MIN_CSS_
@@ -503,628 +503,8 @@
 ';%0A%0A
-/*%0A  ======== A Handy Little Nodeunit Reference ========%0A  https://github.com/caolan/nodeunit%0A%0A  Test methods:%0A    test.expect(numAssertions)%0A    test.done()%0A  Test assertions:%0A    test.ok(value, %5Bmessage%5D)%0A    test.equal(actual, expected, %5Bmessage%5D)%0A    test.notEqual(actual, expected, %5Bmessage%5D)%0A    test.deepEqual(actual, expected, %5Bmessage%5D)%0A    test.notDeepEqual(actual, expected, %5Bmessage%5D)%0A    test.strictEqual(actual, expected, %5Bmessage%5D)%0A    test.notStrictEqual(actual, expected, %5Bmessage%5D)%0A    test.throws(block, %5Berror%5D, %5Bmessage%5D)%0A    test.doesNotThrow(block, %5Berror%5D, %5Bmessage%5D)%0A    test.ifError(value)%0A*/%0A%0A
 expo
@@ -926,33 +926,101 @@
     test.expect(
-1
+2);%0A    test.ok(fs.existsSync(MIN_JS_FILE), 'minified js file exists'
 );%0A    test.ok(f
@@ -1061,19 +1061,23 @@
 ied 
+css 
 file
-s
  exist
+s
 ');%0A

test for minified js file added