Skip to content
This repository has been archived by the owner on Dec 2, 2023. It is now read-only.

Commit

Permalink
update mustacher tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sixertoy committed Aug 26, 2015
1 parent 98f4884 commit 89c0e1f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions spec/src/mustacher.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@
});

describe('render', function () {
it('throw a mustacher error at handlebar compile', function () {
sinon.stub(handlebars, 'compile', function(){
throw new Error('Handlebars compile error');
});
expect(function () {
mustacher('{{content}}');
}).to.throw('Handlebars compile error');
handlebars.compile.restore();
});
it('throw if no argument', function () {
expect(function () {
mustacher();
Expand Down
2 changes: 1 addition & 1 deletion src/mustacher.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
template = handlebars.compile(str);
return template(context, {data: data});
} catch (e) {
throw new Error('Mustacher error');
throw new Error('Handlebars compile error');
}
};

Expand Down

0 comments on commit 89c0e1f

Please sign in to comment.