Sha256: c3f9006804caee42a7b8d14f074396bd8d3ce824c5d9212bfe3be22d21a73fd0

Contents?: true

Size: 954 Bytes

Versions: 2

Compression:

Stored size: 954 Bytes

Contents

require 'spec_helper'

module Hemingway

  describe Parser do

    before do
      @parser = Parser.new
    end

    describe "#center" do

      it 'centers text' do
        html = @parser.parse("\\begin{center} So show my why you're strong. \n\n Ignore everybody else \n\n We're alone now \\end{center}").html
        html.should == "<div class='entry'><p><div class='center'>So show my why you're strong. \n\n Ignore everybody else \n\n We're alone now </div></p></div>"
      end

      it 'centers content too' do
        html = @parser.parse("The New James Blake: \\begin{center} So show my why you're \\emph{strong}. \n\n Ignore \\textsc{everybody} else \n\n We're alone now \\end{center}").html
        html.should == "<div class='entry'><p>The New James Blake: <div class='center'>So show my why you're <em>strong</em>. \n\n Ignore <span class='textsc'>everybody</span> else \n\n We're alone now </div></p></div>"
      end

    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hemingway-1.0.0 spec/nodes/block/center_spec.rb
hemingway-0.0.3 spec/nodes/block/center_spec.rb