/*global after, before, describe, it*/
'use strict';
var assert  = require('assert');
var grunt = require('grunt');
var path = require('path');
var sinon = require('sinon');

var statici18n = require('../tasks/statici18n');
statici18n(grunt);

describe('exists', function() {
  after(function() {
    grunt.log.warn.restore();
  });
  it('should nag and filter if the file is missing', function() {
    sinon.stub(grunt.log, 'warn');
    assert.equal(false, statici18n.exists('some/fake/file.txt'));
    sinon.assert.calledOnce(grunt.log.warn);
  });
  it('returns true with some real file', function() {
    var readme = path.join(__dirname, '..', 'README.md');
    assert.ok(statici18n.exists(readme));
  });
});

@@ -704,12 +704,296 @@
 ;%0A  %7D);%0A%7D);%0A
+%0Adescribe('static i18n task', function() %7B%0A  it('should create a file for french', function() %7B%0A    var i18n = path.join(__dirname, 'fixtures', 'app', 'i18n');%0A    var f = path.join(i18n, 'fr', 'static', 'data.json');%0A    assert.ok(grunt.file.exists(f), 'Not found: ' + f);%0A  %7D);%0A%7D);%0A

Test for a french file (fails)