Sha256: 438ad998678265ef3c9e0694708971d8bb4891beb11c85e5a087d2e5bc4f39ea
Contents?: true
Size: 1.86 KB
Versions: 12
Compression:
Stored size: 1.86 KB
Contents
main: This is a basic template example to test the RGen template compiler. main: main: Verify that the target objects can be accessed: main: % $nvm.reg(:data).write(0x5555) main: Data: 0x<%= $nvm.reg(:data).val.to_s(16).upcase %> main: main: Verify that sub templates can be rendered and executed within their own context: main: <%= render "sub1" %> main: Verify that import is an alias for render main: <%= import "sub1" %> main: main: Rendering the template should not disrupt the current context, verify that the main: data is still 0x5555: main: main: Data: 0x<%= $nvm.reg(:data).val.to_s(16).upcase %> main: main: Verify that option data can be passed to rendered templates, the data main: printed here should be 0x1234: main: <%= render "sub1", data: 0x1234 %> main: main: Again verify that the current context is still intact: main: Data: 0x<%= $nvm.reg(:data).val.to_s(16).upcase %> main: main: Verify that templates from sub directories can be rendered: main: <%= render "sub_dir/sub2" %> main: main: Again verify that the current context is still intact: main: Data: 0x<%= $nvm.reg(:data).val.to_s(16).upcase %> main: main: Verify that no extra linebreaks are added: <%= render "sub4.txt.erb" %> main: This should butt up against the sub 4 line main: main: And that leading spaces are stripped, there should be main: no leading whitespace before the sub 4 line: <%= render "sub4.txt.erb" %> main: This is a test that helpers can compile templates inline <%= test_compile_inline_from_helper %> main: This is a test that indent works <%= render "sub1", indent: 10 %> main: Verify by default that render will reload the target, main: the value here should be blank % $nvm.attribute_x = "X" <%= render "sub5" %> main: Verify that target reload can optionally be inhibited, main: the value here should be X % $nvm.attribute_x = "X" <%= render "sub5", preserve_target: true %>
Version data entries
12 entries across 12 versions & 1 rubygems