# encoding=utf-8 require 'spec_helper' describe 'Polytexnic::Pipeline#to_html' do subject(:processed_text) { Polytexnic::Pipeline.new(polytex).to_html } describe '\chapter' do context "with a name" do let(:polytex) do <<-'EOS' \chapter{Foo \emph{bar}} \label{cha:foo} EOS end let(:output) do <<-'EOS'
EOS end it { should resemble output } end context "with no name" do let(:polytex) do <<-'EOS' \chapter{} \label{cha:foo} EOS end let(:output) do <<-'EOS' EOS end it { should resemble output } end end describe '\section' do let(:polytex) do <<-'EOS' \section{Foo} \label{sec:foo} EOS end let(:output) do <<-'EOS' EOS end it { should resemble output } end describe '\subsection' do let(:polytex) do <<-'EOS' \section{Foo} \label{sec:foo} \subsection{Bar} \label{sec:bar} EOS end let(:output) do <<-'EOS' EOS end it { should resemble output } end describe '\subsubsection' do let(:polytex) do <<-'EOS' \chapter{The Chapter} \label{cha:the_chapter} \section{Foo} \label{sec:foo} \subsection{Bar} \label{sec:bar} \subsubsection{Baz} \label{sec:baz} EOS end let(:output) do <<-'EOS' EOS end it { should resemble output } end describe '\chapter*' do let(:polytex) do <<-'EOS' \chapter*{Preface} Lorem ipsum EOS end it { should resemble '