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.6.5 spec/server/template_parser_spec.rb
volt-0.6.4 spec/server/template_parser_spec.rb
volt-0.6.3 spec/server/template_parser_spec.rb
volt-0.6.2 spec/server/template_parser_spec.rb
volt-0.6.1 spec/server/template_parser_spec.rb
volt-0.6.0 spec/server/template_parser_spec.rb
volt-0.5.18 spec/server/template_parser_spec.rb
volt-0.5.17 spec/server/template_parser_spec.rb
volt-0.5.16 spec/server/template_parser_spec.rb
volt-0.5.15 spec/server/template_parser_spec.rb
volt-0.5.14 spec/server/template_parser_spec.rb
volt-0.5.13 spec/server/template_parser_spec.rb
volt-0.5.12 spec/server/template_parser_spec.rb
volt-0.5.11 spec/server/template_parser_spec.rb
volt-0.5.10 spec/server/template_parser_spec.rb
volt-0.5.9 spec/server/template_parser_spec.rb
volt-0.5.8 spec/server/template_parser_spec.rb
volt-0.5.7 spec/server/template_parser_spec.rb
volt-0.5.6 spec/server/template_parser_spec.rb
volt-0.5.4 spec/server/template_parser_spec.rb