Sha256: 04b04fa345071885e60cf7dc501d63e2bb08edf878644347da25c0c743b00ba7

Contents?: true

Size: 1.43 KB

Versions: 1

Compression:

Stored size: 1.43 KB

Contents

# encoding=utf-8
require 'spec_helper'

describe 'Polytexnic::Pipeline#to_html' do

  subject(:processed_text) { Polytexnic::Pipeline.new(polytex).to_html }

  describe "text formatting" do

    describe "italics" do
      let(:polytex) { '\emph{foo bar}' }
      it { should resemble '<em>foo bar</em>' }


      context "multiple instances" do
        let(:polytex) do
          '\emph{foo bar} and also \emph{baz quux}'
        end

        it { should resemble '<em>foo bar</em>' }
        it { should resemble '<em>baz quux</em>' }
      end
    end

    describe "boldface" do
      let(:polytex) { '\textbf{boldface}' }
      it { should resemble '<strong>boldface</strong>' }
    end

    describe "small caps" do
      let(:polytex) { '\textsc{small caps}' }
      it { should resemble '<span class="sc">small caps</span>' }
    end

    describe "typewriter text" do
      let(:polytex) { '\texttt{typewriter text}' }
      it { should resemble '<span class="tt">typewriter text</span>' }
    end

    describe "strikeout text" do
      let(:polytex) { '\sout{foo} bar' }
      it { should resemble '<del>foo</del> bar' }
    end

    describe "custom kode command" do
      let(:polytex) { '\kode{function\_name}' }
      it { should resemble '<code>function_name</code>' }
    end

    describe "color command" do
      let(:polytex) { '\coloredtext{red}{text}' }
      it { should resemble '<span style="color: red">text</span>' }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polytexnic-0.9.10 spec/to_html/text_formatting_spec.rb