Sha256: b21522994ab90335c55565a3970a87d3eeb3f4c9527b6d57fe835ba30ba14246

Contents?: true

Size: 1.05 KB

Versions: 8

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'

describe "template parsers" do

  let(:simple_quote)        { load_fixture :simple_quote }
  let(:simple_quote_output) { load_fixture :simple_quote_output, :html }

  context "erb" do

    it "can render a template" do
      expect(Shortcode.process(simple_quote).gsub("\n",'')).to eq(simple_quote_output)
    end

  end

  context "haml" do

    before(:each) do
      Shortcode.setup do |config|
        config.template_parser = :haml
        config.template_path = File.join File.dirname(__FILE__), "support/templates/haml"
      end
    end

    it "can render a template" do
      expect(Shortcode.process(simple_quote).gsub("\n",'')).to eq(simple_quote_output)
    end

  end

  context "slim" do

    before(:each) do
      Shortcode.setup do |config|
        config.template_parser = :slim
        config.template_path = File.join File.dirname(__FILE__), "support/templates/slim"
      end
    end

    it "can render a template" do
      expect(Shortcode.process(simple_quote).gsub("\n",'')).to eq(simple_quote_output)
    end

  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
shortcode-1.1.1 spec/template_parsers_spec.rb
shortcode-1.1.0 spec/template_parsers_spec.rb
shortcode-1.0.2 spec/template_parsers_spec.rb
shortcode-1.0.0 spec/template_parsers_spec.rb
shortcode-0.4.3 spec/template_parsers_spec.rb
shortcode-0.4.2 spec/template_parsers_spec.rb
shortcode-0.4.1 spec/template_parsers_spec.rb
shortcode-0.4.0 spec/template_parsers_spec.rb