Sha256: 5e8a51cbb722730bece0b6b290e89b9900f1460886fb3bbfd5e55acf35ecdab2

Contents?: true

Size: 740 Bytes

Versions: 6

Compression:

Stored size: 740 Bytes

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/content')

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

  def setup
    @directives = MasterView::DirectiveSet.new
    @tag = MasterView::Tag.new(@directives, 'foo', {}, :normal, nil)
  end

  def test_hello
    @directives.directives = []
    attr_value = 'hello world'
    @directives << Content.new(attr_value)
    dcs = @directives.determine_dcs(:etag)
    dcs.context = @tag.create_context
    assert_equal '', dcs.render.join
    assert_equal "<%= #{attr_value} %>", dcs.context[:tag].content
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
masterview-0.2.0 test/unit/directive_content_test.rb
masterview-0.2.1 test/unit/directive_content_test.rb
masterview-0.2.2 test/unit/directive_content_test.rb
masterview-0.2.3 test/unit/directive_content_test.rb
masterview-0.2.4 test/unit/directive_content_test.rb
masterview-0.2.5 test/unit/directive_content_test.rb