Sha256: b4f921d2d109e1a280446324c7c57f63eafe21be85e12ecce46c49b06d5a84a3
Contents?: true
Size: 1.1 KB
Versions: 12
Compression:
Stored size: 1.1 KB
Contents
require "spec_helper" describe Blogit::Parsers::MarkdownParser do let(:parser) { Blogit::Parsers::MarkdownParser.new("## Some textile\n\nA paragraph") } let(:desired_output) { Regexp.new("<h2>Some textile</h2>\n\n<p>A paragraph</p>\n") } it "should return an html string of content passed when calling parsed" do parser.parsed.should =~ desired_output end describe "code highlighting" do let(:parser) { Blogit::Parsers::MarkdownParser.new("## Header\n\n``` ruby\nputs 'hello world'\n```") } it "should highlight code if highlight_code_syntax is true" do Blogit::configuration.highlight_code_syntax = true parser.parsed.should =~ Regexp.new("<h2>Header</h2>\n<div class=\"highlight\"><pre><span class=\"nb\">puts</span> <span class=\"s1\">'hello world'</span>\n</pre>\n</div>\n") end it "shoud not highlight code if highlight_code_syntax is false" do Blogit.configuration.highlight_code_syntax = false parser.parsed.should == "<h2>Header</h2>\n\n<pre><code class=\"ruby\">puts 'hello world'\n</code></pre>\n" end end end
Version data entries
12 entries across 12 versions & 1 rubygems