Sha256: 68090e22fb6371fccf01204944004c2d9744c9b055e3a7808bad2576419f53e7

Contents?: true

Size: 1.2 KB

Versions: 3

Compression:

Stored size: 1.2 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/insert_generated_comment')
require File.join( currentPath, '../directive_test_helper' )
DirectiveTestHelpers.load_masterview_directive('insert_generated_comment')

class TestInsertGeneratedComment < Test::Unit::TestCase
  include DirectiveTestHelpers

  InsertGeneratedComment = MasterView::Directives::InsertGeneratedComment  # test subject

  ELEMENT_TAG = 'div'

  def setup
    create_template_element ELEMENT_TAG
  end

  def test_metadata
    assert_equal MasterView::ConfigSettings.namespace_prefix, InsertGeneratedComment.namespace_prefix
    assert_equal 'insert_generated_comment', InsertGeneratedComment.attribute_name
  end

  def test_insert_generated_comment
    attr_value = ''
    create_directive InsertGeneratedComment, attr_value
    assert_equal "\n<%\n#    WARNING - This is a generated file created by MasterView.\n#    Do not edit - changes will be lost when this file is re-generated.\n#\n#    To make changes, edit the MasterView source file located at:\n#    \n-%>", render_element_event(:stag)
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
masterview-0.3.3 test/unit/directive_insert_generated_comment_test.rb
masterview-0.3.2 test/unit/directive_insert_generated_comment_test.rb
masterview-0.3.4 test/unit/directive_insert_generated_comment_test.rb