From 5f31d4cbc2b76c6181fe2f8e8123262a901ef4f0 Mon Sep 17 00:00:00 2001 From: Sebastian Cohnen Date: Sun, 18 Oct 2009 11:58:24 +0100 Subject: [PATCH] Re-enabled test for clean context in case of recursion --- test/mustache_spec.rb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test/mustache_spec.rb b/test/mustache_spec.rb index 142c175..a01de57 100644 --- a/test/mustache_spec.rb +++ b/test/mustache_spec.rb @@ -12,18 +12,18 @@ describe "mustache" do @mustache = File.read(__DIR__ + "/../mustache.js") end - # it "should clear the context after each run" do - # js = <<-JS - # #{@mustache} - # Mustache.to_html("{{#list}}{{x}}{{/list}}", {list: [{x: 1}]}) - # try { - # print(Mustache.to_html("{{#list}}{{x}}{{/list}}", {list: [{}]})); - # } catch(e) { - # print('ERROR: ' + e); - # } - # JS - # run_js(js).should == "ERROR: Can't find x in [object Object]\n" - # end + it "should clear the context after each run" do + js = <<-JS + #{@mustache} + Mustache.to_html("{{#list}}{{x}}{{/list}}", {list: [{x: 1}]}) + try { + print(Mustache.to_html("{{#list}}{{x}}{{/list}}", {list: [{}]})); + } catch(e) { + print('ERROR: ' + e); + } + JS + run_js(js).should == "ERROR: Can't find x in [object Object]\n" + end testnames.each do |testname| describe testname do