Просмотр исходного кода

Re-enabled test for clean context in case of recursion

tags/0.2
Sebastian Cohnen 16 лет назад
Родитель
Сommit
5f31d4cbc2
1 измененных файлов: 12 добавлений и 12 удалений
  1. +12
    -12
      test/mustache_spec.rb

+ 12
- 12
test/mustache_spec.rb Просмотреть файл

@@ -12,18 +12,18 @@ describe "mustache" do
@mustache = File.read(__DIR__ + "/../mustache.js") @mustache = File.read(__DIR__ + "/../mustache.js")
end 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| testnames.each do |testname|
describe testname do describe testname do


Загрузка…
Отмена
Сохранить