Skip to content

Commit

Permalink
Added interpolation exception test
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Aug 2, 2010
1 parent 0928f03 commit a7d4d3b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/jade.test.js
Expand Up @@ -281,7 +281,7 @@ module.exports = {
err.message);
},

'test exceptions': function(assert){
'test code exceptions': function(assert){
var err;
try {
render('p= foo', { cache: true, filename: 'foo', locals: { foo: 'bar' }});
Expand All @@ -294,6 +294,18 @@ module.exports = {
err.message);
},

'test interpolation exceptions': function(assert){
var err;
try {
render('p #{foo}');
} catch (e) {
err = e;
}
assert.equal(
"Jade:1\n 1. 'p #{foo}'\n\nfoo is not defined",
err.message);
},

'test html 5 mode': function(assert){
assert.equal('<!DOCTYPE html><input type="checkbox" checked>', render('!!! 5\ninput(type="checkbox", checked)'));
assert.equal('<!DOCTYPE html><input type="checkbox" checked>', render('!!! 5\ninput(type="checkbox", checked: true)'));
Expand Down

0 comments on commit a7d4d3b

Please sign in to comment.