Sfoglia il codice sorgente

Re-enabled test for clean context in case of recursion

tags/0.2
Sebastian Cohnen 16 anni fa
parent
commit
5f31d4cbc2
1 ha cambiato i file con 12 aggiunte e 12 eliminazioni
  1. +12
    -12
      test/mustache_spec.rb

+ 12
- 12
test/mustache_spec.rb Vedi File

@@ -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


Loading…
Annulla
Salva