Sha256: 3371ef7e2ee61014a8c08d0e93ad62668d2fbc9013da59a5bdaca5a2105c5ab9

Contents?: true

Size: 1.28 KB

Versions: 55

Compression:

Stored size: 1.28 KB

Contents

# require 'volt/server/template_parser'
# 
# describe TemplateParser do
#   it 'should parse a doc' do
#     template = <<-END
#       <h1>Header {name}</h1>
#   
#       <p class="{paragraph_class}">{content}</p>
#   
#       <!-- Original Comment -->
#       {#each some_array}
#         <p>Line {some_name}</p>
#       {/}
#   
#     END
#     parser = TemplateParser.new(template, 'main')
#   end
#   
#   it 'should parse nested' do
#     template = <<-END
#       <div class="test">
#         <div class="test2">
#           <h1>Header</h1>
#         </div>
#       </div>
#     END
#     parser = TemplateParser.new(template, 'main')
#   end
#   
#   it "should parse nested bindings" do
#     template = <<-END
#     1{#if _a}2
#       3{#if _b}4
#         _a and _b
#       {/}
#     {/}
#     END
#     parser = TemplateParser.new(template, 'main')
#     
#     expect(parser.templates.keys).to eq(["main/body", "main/body/__template/1", "main/body/__template/0"])
#     expect(parser.templates['main/body/__template/1']).to eq({"html"=>"4\n        _a and _b\n      ", "bindings"=>{}})
#   end
# 
#   it "should parse templates in attributes" do
#     template = <<-END
#     <div class="{#if _model._is_cool}cool{/}">yes</div>
#     END
#     parser = TemplateParser.new(template, 'main')
#   end
# end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
volt-0.3.9 spec/server/template_parser_spec.rb
volt-0.3.8 spec/server/template_parser_spec.rb
volt-0.3.7 spec/server/template_parser_spec.rb
volt-0.3.6 spec/server/template_parser_spec.rb
volt-0.3.5 spec/server/template_parser_spec.rb
volt-0.3.4 spec/server/template_parser_spec.rb
volt-0.3.3 spec/server/template_parser_spec.rb
volt-0.3.2 spec/server/template_parser_spec.rb
volt-0.3.1 spec/server/template_parser_spec.rb
volt-0.3.0 spec/server/template_parser_spec.rb
volt-0.2.9 spec/server/template_parser_spec.rb
volt-0.2.7 spec/server/template_parser_spec.rb
volt-0.2.5 spec/server/template_parser_spec.rb
volt-0.2.4 spec/server/template_parser_spec.rb
volt-0.2.3 spec/server/template_parser_spec.rb