Sha256: d1e3326052b5613eb699104ac7af27f489030e593f343a7b22cfd0cc2fa9fda1

Contents?: true

Size: 1.17 KB

Versions: 21

Compression:

Stored size: 1.17 KB

Contents

#!/usr/bin/env ruby

require 'test/unit'
currentPath = File.dirname(__FILE__)
require File.join( currentPath, '../lib/masterview' )
require File.join( currentPath, '../lib/masterview/directives/global_inline_erb')

class TestGlobalInlineErb < Test::Unit::TestCase
  include MasterView::Directives

  def setup
    @directives = MasterView::DirectiveSet.new
  end

  def test_hello
    @tag = MasterView::Tag.new(@directives, 'foo', {'hello' => 'foo bar {{{=hello world}}}', 'world' => '{{{fine}}}'}, :normal, nil)
    @directives.directives = []
    @directives << Global_inline_erb.new
    @directives << MasterView::SimpleRenderHandler.new
    dcs = @directives.determine_dcs(:stag)
    dcs.context = @tag.create_context
    assert_equal '<foo hello="foo bar <%=hello world%>" world="<%fine%>">', dcs.render.join
    #assert_equal "<%= #{attr_value} %>", dcs.context[:tag].content

    dcs = @directives.determine_dcs(:characters)
    dcs.context = @tag.create_context(:content_part => 'more text here {{{= foo(bar) }}} more then {{{exec {:hello => :world} }}} finally')
    assert_equal 'more text here <%= foo(bar) %> more then <%exec {:hello => :world} %> finally', dcs.render.join
  end

end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
masterview-0.0.11 test/global_inline_erb_test.rb
masterview-0.0.15 test/global_inline_erb_test.rb
masterview-0.0.2 test/global_inline_erb_test.rb
masterview-0.0.10 test/global_inline_erb_test.rb
masterview-0.0.12 test/global_inline_erb_test.rb
masterview-0.0.13 test/global_inline_erb_test.rb
masterview-0.0.14 test/global_inline_erb_test.rb
masterview-0.0.16 test/global_inline_erb_test.rb
masterview-0.0.17 test/global_inline_erb_test.rb
masterview-0.0.7 test/global_inline_erb_test.rb
masterview-0.0.8 test/global_inline_erb_test.rb
masterview-0.0.9 test/global_inline_erb_test.rb
masterview-0.1.0 test/global_inline_erb_test.rb
masterview-0.1.1 test/global_inline_erb_test.rb
masterview-0.1.2 test/global_inline_erb_test.rb
masterview-0.1.3 test/global_inline_erb_test.rb
masterview-0.1.5 test/global_inline_erb_test.rb
masterview_parser-0.0.3 test/global_inline_erb_test.rb
masterview_parser-0.0.4 test/global_inline_erb_test.rb
masterview_parser-0.0.5 test/global_inline_erb_test.rb