Sha256: e425ac1a29d592feb80f1c207d6ae8af6bfa4a5e275ba54183aed185850488fb

Contents?: true

Size: 1019 Bytes

Versions: 1

Compression:

Stored size: 1019 Bytes

Contents

#!/usr/bin/env ruby
require File.join(File.dirname(__FILE__), "..", "spec_helper")

describe "Filter Macros" do

	before do
		delete_project
		create_project
		Glyph.run! 'load:macros'
	end

	after do
		delete_project
	end
	
	it "should filter textile input" do
		text = "textile[This is a _TEST_(TM).]"
		interpret text
		@p.document.output.should == "<p>This is a <em><span class=\"caps\">TEST</span></em>&#8482;.</p>"
		Glyph['filters.target'] = :latex
		interpret text
		@p.document.output.should == "This is a \\emph{TEST}\\texttrademark{}.\n\n"
		Glyph['filters.target'] = :html
		Glyph['filters.redcloth.restrictions'] = [:no_span_caps]
		interpret text
		@p.document.output.should == "<p>This is a <em>TEST</em>&#8482;.</p>"
	end

	it "should filter markdown input" do
		text = "markdown[This is a test:

- item 1
- item 2
- item 3

etc.]"
		interpret text
		@p.document.output.gsub(/\n|\t/, '').should == 
			"<p>This is a test:</p><ul><li>item 1</li><li>item 2</li><li>item 3</li></ul><p>etc.</p>"
	end

end	

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
glyph-0.2.0 spec/macros/filters_spec.rb