Sha256: 3243f1a8a7d9fdecf54af55a90d44b2f30aa6ec40e997a24825a96bb48a32e1d
Contents?: true
Size: 906 Bytes
Versions: 8
Compression:
Stored size: 906 Bytes
Contents
# -*- encoding: utf-8 -*- require 'test/unit' require 'helper' require 'webgen/websiteaccess' require 'webgen/contentprocessor' class TestContentProcessorRedCloth < Test::Unit::TestCase include Test::WebsiteHelper def test_call @obj = Webgen::ContentProcessor::RedCloth.new node = Webgen::Node.new(Webgen::Tree.new.dummy_root, '/', '/') context = Webgen::Context.new(:content => "h1. header\n\nthis\nis\nsome\ntext", :chain => [node]) assert_equal("<h1>header</h1>\n<p>this\nis\nsome\ntext</p>", @obj.call(context).content) context.content = "h1. header\n\nthis\nis\nsome\ntext" @website.config['contentprocessor.redcloth.hard_breaks'] = true assert_equal("<h1>header</h1>\n<p>this<br />\nis<br />\nsome<br />\ntext</p>", @obj.call(context).content) def @obj.require(lib); raise LoadError; end assert_raise(Webgen::LoadError) { @obj.call(context) } end end
Version data entries
8 entries across 8 versions & 1 rubygems