Skip to content

Commit

Permalink
index tests.
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
mattyod committed Jul 2, 2014
1 parent 15d3315 commit c7eba30
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions test/unit/lib/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
'use strict';

var index = require('../../../lib/index');

describe('lib/index', sandbox(function () {
var config, result, expected;

beforeEach(function () {
this.clipboard = {
files: {
'index.html': '123',
schemas: {
'bar.json': '123',
bars: {
'baz.json': '123'
}
},
ignored: {
'foo': '123'
}
}
};

config = {
index: {
schemas: true
}
};

expected = {
files: {
'index.html': 'index.html',
schemas: {
'bar.json': 'schemas/bar.json',
bars: {
'baz.json': 'schemas/bars/baz.json'
}
}
}
};

result = index.call(this, config);
});

it('returns an object which indexes all the files from the clipboard', function () {
result.should.deep.equal(expected);
});

}));

0 comments on commit c7eba30

Please sign in to comment.