Permalink
Browse files

Revert "Get basic variable include working, added test"

This reverts commit cd549b7.
  • Loading branch information...
1 parent 366231d commit 259aa234e43fcd19e4038cd87c8f259c92f2583a @mde mde committed Jan 4, 2015
Showing with 2 additions and 30 deletions.
  1. +2 −11 lib/ejs.js
  2. +0 −7 test/ejs.js
  3. +0 −12 test/fixtures/menu_var.ejs
View
@@ -157,18 +157,9 @@ var parse = exports.parse = function(str, options){
}
if (0 == js.trim().indexOf('include')) {
- var name = js.trim().slice(7).trim(),
- path;
+ var name = js.trim().slice(7).trim();
if (!filename) throw new Error('filename option is required for includes');
-
- // Path is a value in the local variables
- if (options[name]) {
- path = resolveInclude(options[name], filename);
- }
- // Actual path
- else {
- path = resolveInclude(name, filename);
- }
+ var path = resolveInclude(name, filename);
include = read(path, 'utf8');
include = exports.parse(include, { filename: path, _with: false, open: open, close: close, compileDebug: compileDebug });
buf += "' + (function(){" + include + "})() + '";
View
@@ -295,13 +295,6 @@ describe('includes', function(){
.should.equal(fixture('menu.html'));
})
- it('should work with a variable path', function(){
- var file = 'test/fixtures/menu_var.ejs',
- includePath = 'includes/menu-item';
- ejs.render(fixture('menu.ejs'), { filename: file, pets: users, varPath: includePath})
- .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 })
View
@@ -1,12 +0,0 @@
-<% var url = '/foo' -%>
-<% var title = 'Foo' -%>
-<% include varPath -%>
-
-<% var url = '/bar' -%>
-<% var title = 'Bar' -%>
-<% include varPath -%>
-
-<% var url = '/baz' -%>
-<% var title = 'Baz' -%>
-<% include varPath -%>
-

0 comments on commit 259aa23

Please sign in to comment.