
var fs = require('fs');
var test = require('colored-tape');
var Zmanager = require('../');

function fixture (name) {
  return fs.readFileSync('test/fixtures/' + name + '.css', 'utf-8').trim();
}

test('create', function (t) {
  var z = new Zmanager(fixture('z-index'));

  var result = z.create();
  var expected = {
    "1": ".z1",
    "2": ".z2",
    "3": ".z3",
    "4": ".z4"
  };

  t.same(result, expected);

  t.end();
});

test('manage', function (t) {
  var z = new Zmanager(fixture('z-index'));

  var zmanagerc = {
    "1": ".z4",
    "2": ".z2",
    "3": ".z1",
    "4": ".z3"
  };

  var result = z.manage(zmanagerc);
  var expected = fixture('z-manage-result');

  t.same(result, expected);

  t.end();
});

@@ -519,22 +519,18 @@
 agerc = 
+'
 %7B
-%0A    
 %221%22: %22.z
@@ -532,21 +532,16 @@
 : %22.z4%22,
-%0A    
 %222%22: %22.z
@@ -535,37 +535,32 @@
 .z4%22,%222%22: %22.z2%22,
-%0A    
 %223%22: %22.z1%22,%0A    
@@ -554,21 +554,16 @@
 : %22.z1%22,
-%0A    
 %224%22: %22.z
@@ -564,20 +564,18 @@
 %22: %22.z3%22
-%0A  
 %7D
+'
 ;%0A%0A  var

modify test code