Sha256: 39bbb7454c5ba94eec15a29c2f6f62a890a1d983096db2ed865ffdfaeca06404

Contents?: true

Size: 1.48 KB

Versions: 3

Compression:

Stored size: 1.48 KB

Contents

require 'spec_helper'

describe 'MustacheRender::Mustache.db_render' do
  before :each do
    MustacheRender.configure do |config|
      config.file_template_root_path = ROOT_PATH + '/resources/templates'
    end
  end

  it 'file render generate template value' do
    fr = MustacheRender::Mustache.new

    result = fr.render "{{render}}:{{context}}", {:render => 'render', :context => 'context'}
    result.should == "render:context"
  end

  it 'template scan_tags test' do
    result = MustacheRender::Mustache.file_render 'scan_tags/1', {}

  end

  it 'template file 5.mustache render ok' do
    result = MustacheRender::Mustache.file_render 'basic/5', {}
    result.should == <<-TEXT
file:5, in-file6

file:5-2, in-file6

file:5-3, in-file6

file:5-4, in-file6

file:5-5, in-file6

file:5-6, in-file6

file:5-7, in-file6

file:5-8, in-file6

file:5-9, in-file6

file:5-10, in-file6

file:5-11, in-file6

TEXT
  end

  it 'template file 1.mustache render ok' do
    result = MustacheRender::Mustache.file_render 'basic/1', {:filename => '1.mustache'}
    result.should == <<-TEXT
Hello!1.mustache
TEXT
  end

  it 'template 2 with partial 1 render OK' do
     result = MustacheRender::Mustache.file_render 'basic/2', {:filename => 'in1'}
     result.should == <<-TEXT
file-2Hello!in1

TEXT
  end

  it 'template file 3.mustache partial with 2 render OK' do
     result = MustacheRender::Mustache.file_render 'basic/3', {:filename => 'in1'}
     result.should == <<-TEXT
file3file-2Hello!in1


TEXT

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mustache_render-0.0.24 spec/lib/mustache/file_render_spec.rb
mustache_render-0.0.23 spec/lib/mustache/file_render_spec.rb
mustache_render-0.0.22 spec/lib/mustache/file_render_spec.rb