Sha256: 779cdcfaac53e1c48809dcc14578fcad6b8401d48a5b04bbde6230e3c7370790

Contents?: true

Size: 656 Bytes

Versions: 2

Compression:

Stored size: 656 Bytes

Contents

require "assert"
require "undies/template"

require 'undies/io'
require 'undies/source'

class Undies::Template

  class BuilderRenderTests < Assert::Context
    desc 'a template rendered using the builder approach'
    before do
      @src = Undies::Source.new(Proc.new {})
      @io = Undies::IO.new(@out = "")
      @t = Undies::Template.new(@src, {}, @io)
    end
    subject { @t }

    should "maintain scope throughout the build blocks" do
      templ = Undies::Template.new(@io)
      templ._div {
        templ._div self.object_id
      }
      templ.__flush

      assert_equal "<div><div>#{self.object_id}</div></div>", @out
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
undies-3.1.0 test/unit/template_builder_render_tests.rb
undies-3.0.0 test/unit/template_builder_render_tests.rb