Sha256: c02afb1a6e697235b8b9b0d07bfa528d46cece5b5d09e2d49a7044b887696869
Contents?: true
Size: 1.5 KB
Versions: 73
Compression:
Stored size: 1.5 KB
Contents
require 'spec_helper' describe Softcover::Mathjax do subject(:mathjax) { Softcover::Mathjax } let(:custom_sty) do %(\\newcommand{\\foo}{\\ensuremath{x}} \\newcommand{\\bar}[1]{\\textbf{#1}} % \\newcommand{\\baz}{quux} ) end let(:baz) { 'quux' } shared_examples "config" do it "should include the default macros" do expect(config).to include polytex expect(config).to include polytexnic end context "with a custom.sty" do before { Softcover.stub(:custom_styles).and_return(custom_sty) } it "should include the custom macros" do expect(config).to include foo expect(config).to include bar end it "should not include a commented-out macro" do expect(config).not_to include baz end end end context '#config' do let(:polytex) { 'PolyTeX: "Poly{\\\\TeX}"' } let(:polytexnic) { 'PolyTeXnic: "Poly{\\\\TeX}nic"' } let(:foo) { 'foo: "{x}"' } let(:bar) { 'bar: ["\\\\textbf{#1}", 1]' } let(:config) { mathjax.config } it "should not raise an error" do expect { config }.not_to raise_error end it_should_behave_like "config" end context '#escaped_config' do let(:polytex) { 'PolyTeX: "Poly{\\\\\\\\TeX}"' } let(:polytexnic) { 'PolyTeXnic: "Poly{\\\\\\\\TeX}nic"' } let(:foo) { 'foo: "{x}"' } let(:bar) { 'bar: ["\\\\\\\\textbf{#1}", 1]' } let(:config) { mathjax.escaped_config } it_should_behave_like "config" end end
Version data entries
73 entries across 73 versions & 2 rubygems