Sha256: 61785a90904008d2817c0571390612486ac6eaa019ae812f3dc8893d5390212b

Contents?: true

Size: 1.92 KB

Versions: 47

Compression:

Stored size: 1.92 KB

Contents

# encoding=utf-8
require 'spec_helper'

describe 'Polytexnic::Pipeline#to_html' do

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

  describe "quotations and verse" do
    describe '\begin{quote}...\end{quote}' do
      let(:polytex) { '\quote{foo}' }
      it { should resemble "<blockquote class=\"quote\">foo\n</blockquote>" }
    end

    describe "quote environment" do

      context "alone" do
        let(:polytex) do <<-'EOS'
          \begin{quote}
            lorem ipsum

            dolor sit amet
          \end{quote}
          EOS
        end

        it do
          should resemble <<-'EOS'
            <blockquote class="quotation">
              <p>lorem ipsum</p>
              <p>dolor sit amet</p>
            </blockquote>
          EOS
        end
      end

      context "nested" do
        let(:polytex) do <<-'EOS'
          \begin{quote}
            lorem ipsum

            \begin{quote}
              foo bar
            \end{quote}

            dolor sit amet
          \end{quote}
          EOS
        end
        it do
          should resemble <<-'EOS'
            <blockquote class="quotation">
              <p>lorem ipsum</p>
              <blockquote class="quotation">
              <p>foo bar</p>
              </blockquote>
              <p>dolor sit amet</p>
            </blockquote>
          EOS
        end
      end
    end

    describe '\verse' do
      let(:polytex) { '\verse{foo}' }
      it { should resemble "<blockquote class=\"verse\">foo\n</blockquote>" }
    end

    describe "verse environment" do
      let(:polytex) do <<-'EOS'
        \begin{verse}
          lorem ipsum\\
          dolor sit amet
        \end{verse}
        EOS
      end
      it do
        should resemble <<-'EOS'
          <blockquote class="verse">
            <p>lorem ipsum<span class="break"></span>
            dolor sit amet</p>
          </blockquote>
        EOS
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
polytexnic-1.0.1 spec/to_html/quotations_and_verse_spec.rb
polytexnic-1.0.0 spec/to_html/quotations_and_verse_spec.rb
polytexnic-1.0.beta8 spec/to_html/quotations_and_verse_spec.rb
polytexnic-1.0.beta7 spec/to_html/quotations_and_verse_spec.rb
polytexnic-1.0.beta6 spec/to_html/quotations_and_verse_spec.rb
polytexnic-1.0.beta5 spec/to_html/quotations_and_verse_spec.rb
polytexnic-1.0.beta4 spec/to_html/quotations_and_verse_spec.rb
polytexnic-1.0.beta3 spec/to_html/quotations_and_verse_spec.rb
polytexnic-1.0.beta2 spec/to_html/quotations_and_verse_spec.rb
polytexnic-1.0.beta1 spec/to_html/quotations_and_verse_spec.rb
polytexnic-0.9.10 spec/to_html/quotations_and_verse_spec.rb
polytexnic-0.9.9 spec/to_html/quotations_and_verse_spec.rb
polytexnic-0.9.8 spec/to_html/quotations_and_verse_spec.rb
polytexnic-0.9.7 spec/to_html/quotations_and_verse_spec.rb
polytexnic-0.9.6 spec/to_html/quotations_and_verse_spec.rb
polytexnic-0.9.5 spec/to_html/quotations_and_verse_spec.rb
polytexnic-0.9.4 spec/to_html/quotations_and_verse_spec.rb
polytexnic-0.9.3 spec/to_html/quotations_and_verse_spec.rb
polytexnic-0.9.2 spec/to_html/quotations_and_verse_spec.rb
polytexnic-0.9.1 spec/to_html/quotations_and_verse_spec.rb