Permalink
Browse files

Added failing test (Array duck typing not supported by `each`)

  • Loading branch information...
1 parent 9a1e1dc commit 6da416acad1b9b06315294490b68ce0ff61e7b67 @rauchg rauchg committed with tj Feb 2, 2011
Showing with 15 additions and 0 deletions.
  1. +15 −0 test/jade.test.js
View
@@ -726,6 +726,21 @@ module.exports = {
].join('');
assert.equal(html, render(str));
+
+ // Any enumerable (length property)
+ var str = [
+ '- var jQuery = { length: 3, 0: 1, 1: 2, 2: 3 };',
+ '- each item in jQuery',
+ ' li= item'
+ ].join('\n');
+
+ var html = [
+ '<li>1</li>',
+ '<li>2</li>',
+ '<li>3</li>'
+ ].join('');
+
+ assert.equal(html, render(str));
// Empty array
var str = [

0 comments on commit 6da416a

Please sign in to comment.