Browse files

add test for arbitrary includes

  • Loading branch information...
1 parent ad2080a commit 78f96ca43793e00ddafd50f20b0afabcfab54902 @tj committed Jul 20, 2012
Showing with 13 additions and 0 deletions.
  1. +6 −0 test/ejs.js
  2. +1 −0 test/fixtures/include.css.ejs
  3. +3 −0 test/fixtures/include.css.html
  4. +3 −0 test/fixtures/style.css
View
6 test/ejs.js
@@ -178,4 +178,10 @@ describe('includes', function(){
ejs.render(fixture('menu.ejs'), { filename: file, pets: users })
.should.equal(fixture('menu.html'));
})
+
+ it('should include arbitrary files as-is', function(){
+ var file = 'test/fixtures/include.css.ejs';
+ ejs.render(fixture('include.css.ejs'), { filename: file, pets: users })
+ .should.equal(fixture('include.css.html'));
+ })
})
View
1 test/fixtures/include.css.ejs
@@ -0,0 +1 @@
+<style><% var value = 'bar' %><% include style.css %></style>
View
3 test/fixtures/include.css.html
@@ -0,0 +1,3 @@
+<style>body {
+ foo: 'bar';
+}</style>
View
3 test/fixtures/style.css
@@ -0,0 +1,3 @@
+body {
+ foo: '<%= value %>';
+}

0 comments on commit 78f96ca

Please sign in to comment.