$:.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 ) processor = FileProcessor.new(template, "content_path", self) document = processor.process_html_content("") 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