Sha256: ded3cd5dcd6aa324fa0f8df5cb35a3a02c99ccccdedddda1fff43aeb9c9dd427
Contents?: true
Size: 736 Bytes
Versions: 19
Compression:
Stored size: 736 Bytes
Contents
require 'minitest_helper' describe Rasti::Web::Template do class Context include ContextMethodHelper end it 'Plain HTML' do Rasti::Web::Template.render('plain_html').must_equal '<div>Hello world</div>' end it 'Context method' do Rasti::Web::Template.render('context_method', Context.new).must_equal '<h1>Hello world</h1>' end it 'Local variable' do Rasti::Web::Template.render('local_variable', nil, text: 'Welcome').must_equal '<h1>Welcome</h1>' end it 'Invalid template' do proc { Rasti::Web::Template.render 'invalid' }.must_raise RuntimeError end it 'Nested' do Rasti::Web::Template.render('layout') { 'inner text' }.must_equal '<html><body>inner text</body></html>' end end
Version data entries
19 entries across 19 versions & 1 rubygems