Sha256: 12a50fcfac8479b997e457565b789a1d4674add8fa53dfe86301009211954a17

Contents?: true

Size: 919 Bytes

Versions: 12

Compression:

Stored size: 919 Bytes

Contents

require "spec_helper"

describe Machined::Processors::FrontMatterProcessor do
  it "parses the front matter and adds locals" do
    within_construct do |c|
      c.file "pages/index.html.haml", <<-CONTENT.unindent
        ---
        title: Hello
        tags:
        - 1
        - 2
        ---
        = title.inspect
        = tags.inspect
      CONTENT
      
      machined.pages["index.html"].to_s.should == <<-CONTENT.unindent
        "Hello"
        [1, 2]
      CONTENT
    end
  end
  
  it "ignores pages without front matter" do
    within_construct do |c|
      c.file "pages/index.html.md", <<-CONTENT.unindent
        Title
        ---
        Another Title
        ---
        Content...
      CONTENT
      machined.pages["index.html"].to_s.should == <<-CONTENT.unindent
        <h2>Title</h2>
        
        <h2>Another Title</h2>
        
        <p>Content...</p>
      CONTENT
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
machined-0.7.1 spec/machined/processors/front_matter_processor_spec.rb
machined-0.7.0 spec/machined/processors/front_matter_processor_spec.rb
machined-0.6.0 spec/machined/processors/front_matter_processor_spec.rb
machined-0.5.0 spec/machined/processors/front_matter_processor_spec.rb
machined-0.4.0 spec/machined/processors/front_matter_processor_spec.rb
machined-0.3.1 spec/machined/processors/front_matter_processor_spec.rb
machined-0.3.0 spec/machined/processors/front_matter_processor_spec.rb
machined-0.2.2 spec/machined/processors/front_matter_processor_spec.rb
machined-0.2.1 spec/machined/processors/front_matter_processor_spec.rb
machined-0.2.0 spec/machined/processors/front_matter_processor_spec.rb
machined-0.1.1 spec/machined/processors/front_matter_processor_spec.rb
machined-0.1.0 spec/machined/processors/front_matter_processor_spec.rb