Sha256: aa81214dc9bb301f1a82c64677f98a5071dd196c5c5cc806dc81f0d504e2bdce

Contents?: true

Size: 778 Bytes

Versions: 2

Compression:

Stored size: 778 Bytes

Contents

require 'spec_helper'

module Hemingway

  describe Parser do

    before do
      @parser = Parser.new
    end

    describe "#special" do

      it 'should escape a special character' do
        html = @parser.parse("War \\& Peace").html
        html.should == "<div class='entry'><p>War & Peace</p></div>"
      end

      it 'should escape a special backslash character' do
        html = @parser.parse("\\textbackslash{}part").html
        html.should == "<div class='entry'><p>\\part</p></div>"
      end


      it 'should allow for special chars and tags in sequence' do
        html = @parser.parse("War \\& Peace \\textbf{Tolstoy} \\#").html
        html.should == "<div class='entry'><p>War & Peace <strong>Tolstoy</strong> #</p></div>"
      end

    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hemingway-1.0.0 spec/nodes/special_spec.rb
hemingway-0.0.3 spec/nodes/special_spec.rb