Sha256: 43f26935b1af2d18ef202ca90d696676fb054c0e4959695d89218f661ec55069

Contents?: true

Size: 991 Bytes

Versions: 1

Compression:

Stored size: 991 Bytes

Contents

$:.unshift File.join(File.dirname(__FILE__), "..", "..", "lib")

require 'test/unit'
require 'rexml/document'
require 'buildmaster/file_processor'
require 'buildmaster/xtemplate'

module BuildMaster
class FileProcessorTest < Test::Unit::TestCase
  def test_expression_evaluation
    template = XTemplate.new(<<CONTENT
<html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:template="http://buildmaster.rubyforge.org/xtemplate/1.0">
<p>
  <template:attribute name="class" eval="method_one"/>
</p>      
</html>
CONTENT
)
    processor = FileProcessor.new(template, "content_path", self)
    document = processor.process_html_content("<html></html>")
    assert_equal('method one result', 
      REXML::XPath.first(REXML::Document.new(document.to_s), '/html/p/@class').value.strip)
    
  end
  
  def evaluate(expression, path)
    assert_equal('method_one', expression)
    assert_equal('content_path', path)
    return "method one result"
  end
  
end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
BuildMaster-0.7.0 test/buildmaster/tc_file_processor.rb