Skip to content

Commit

Permalink
Test case for instantiator.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Dec 8, 2013
1 parent 3c972fe commit 480ed0f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
24 changes: 24 additions & 0 deletions test/instantiator.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* global describe, it, before, expect */

var Instantiator = require('../lib/instantiator');

describe('Instantiator', function() {

describe('without mechanisms', function() {
var instantiator = new Instantiator();
var error;

before(function(done) {
instantiator.instantiate({}, 'foo', function(err) {
error = err;
return done();
});
});

it('should call callback', function() {
expect(error).to.be.an.instanceOf(Error);
expect(error.message).to.equal("Unable to instantiate 'foo'");
});
});

});
4 changes: 2 additions & 2 deletions test/resolver.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global describe, it, before, expect */
/* global describe, it, expect */

var Resolver = require('../lib/resolver');

Expand Down Expand Up @@ -53,7 +53,7 @@ describe('Resolver', function() {
});
});

describe('with two mechanisms scoped to prefix', function() {
describe('with two mechanisms, each scoped to prefix', function() {
var resolver = new Resolver();
resolver.use('foo', function(id) {
return 'ok-foo-' + id;
Expand Down

0 comments on commit 480ed0f

Please sign in to comment.