# encoding=utf-8 require 'spec_helper' describe 'Polytexnic::Pipeline#to_html' do let(:pipeline) { Polytexnic::Pipeline.new(polytex) } subject(:processed_text) { pipeline.to_html } describe "aside boxes" do let(:polytex) do <<-'EOS' \chapter{Foo bar} \begin{aside} \heading{Lorem ipsum.} \label{aside:lorem} lorem ipsum dolor sit amet \end{aside} Box~\ref{aside:lorem} EOS end it do should resemble <<-'EOS'
EOS end context "with a custom language label" do before do pipeline.stub(:language_labels). and_return({ "chapter" => { "word" => "Chapter", "order" => "standard" }, "aside" => "Cajón" }) end it { should include 'Cajón 1.1' } end end describe "aside cross-references" do let(:aside) do <<-'EOS' \begin{aside} \heading{Lorem ipsum.} \label{aside:lorem} lorem ipsum dolor sit amet \end{aside} Box~\ref{aside:lorem} EOS end context "in a chapter" do let(:prematerial) { "\\chapter{Foo}\n\n\\section{Bar}" } let(:polytex) { prematerial + "\n" + aside} it { should include ">1.1<" } end context "in an article" do let(:polytex) { '\section{A section}' + "\n" + aside } it { should include ">1<" } end end end