'use strict';

var grunt = require('grunt');

/*
  ======== 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.px_to_rem = {
  setUp: function(done) {
    // setup here if necessary
    done();
  },
  default_options: function(test) {
    test.expect(1);

    var actual = grunt.file.read('tmp/style.css');
    var expected = grunt.file.read('test/expected/style.css');
    test.equal(actual, expected, 'should be equal.');

    test.done();
  },
  custom_options: function(test) {
    test.expect(1);

    var actual = grunt.file.read('tmp/style_custom.css');
    var expected = grunt.file.read('test/expected/style_custom.css');
    test.equal(actual, expected, 'should be equal.');

    test.done();
  },
  custom_options_base: function(test) {
    test.expect(1);

    var actual = grunt.file.read('tmp/style_custom_base.css');
    var expected = grunt.file.read('test/expected/style_custom_base.css');
    test.equal(actual, expected, 'should be equal.');

    test.done();
  },

  sourcemap: function(test) {
    test.expect(1);

    var actual = grunt.file.read('tmp/style_sourcemap.css');
    var expected = grunt.file.read('test/expected/style_sourcemap.css');
    test.equal(actual, expected, 'should be equal.');

    test.done();
  },

  sourcemap_custom_options: function(test) {
    test.expect(1);

    var actual = grunt.file.read('tmp/style_sourcemap_custom.css');
    var expected = grunt.file.read('test/expected/style_sourcemap_custom.css');
    test.equal(actual, expected, 'should be equal.');

    test.done();
  },
};
