Skip to content

Instantly share code, notes, and snippets.

@gerad
Created November 28, 2009 03:24
Show Gist options
  • Save gerad/244367 to your computer and use it in GitHub Desktop.
Save gerad/244367 to your computer and use it in GitHub Desktop.
var view = new View();
view.template("show", function() { /*
Hello World
*/ });
view.template("edit", function() { /*
<%= str %>
*/ });
test("can render", function() {
equals(view.render("show"), "Hello World");
});
test("can render with context", function() {
equals(view.render("edit", { str: "Hello World" }), "Hello World");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment