Sha256: 43bd6fb883b351b7a95c97978722cc6913beb691bc4a31b37cf5e9abc45d4826

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 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",'').gsub('>  <', '><')).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

2 entries across 2 versions & 1 rubygems

Version Path
shortcode-1.2.1 spec/template_parsers_spec.rb
shortcode-1.2.0 spec/template_parsers_spec.rb