Sha256: 977b25ec951a79d69bebec86affa7506fd02f89d3bf0afa230c0b95ae189b479

Contents?: true

Size: 1.27 KB

Versions: 7

Compression:

Stored size: 1.27 KB

Contents

require 'spec_helper'

describe Mdoc::Document do
  context 'pandoc style meta header' do
    subject { Mdoc::Document.new('spec/fixtures/pandoc.md') }
    its(:file) { should eq('spec/fixtures/pandoc.md') }
    its(:title) { should eq('Pandoc Title') }
    its(:author) { should eq('Author Like Me') }
    its(:date) { should eq('Date in Some Format') }
    its(:body) { should match(/^The first line of contents/) }
  end

  context 'original style meta header' do
    subject(:doc) { Mdoc::Document.new('spec/fixtures/original.md') }
    its(:title) { should eq('The title for our document') }
    its(:author) { should eq('unknown person') }
    it 'has array and date value assigned' do
      doc.date.strftime('%F').should eq('2009-08-01')
      doc.meta.category[0].should eq('eo.personal')
    end
    its(:body) { should eq("The content inside\n") }
  end

  context 'multikeys style meta header' do
    subject(:doc) { Mdoc::Document.new('spec/fixtures/multikeys.md') }
    its(:file) { should eq('spec/fixtures/multikeys.md') }
    its(:title) { should eq('The title for our document') }
    its(:author) { should eq('unknown person too') }
    it 'has array value assigned' do
      doc.meta.tag[1].should eq('file')
    end
    its(:body) { should eq("The content inside\n") }
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mdoc-0.0.11 spec/document_spec.rb
mdoc-0.0.10 spec/document_spec.rb
mdoc-0.0.9 spec/document_spec.rb
mdoc-0.0.8 spec/document_spec.rb
mdoc-0.0.7 spec/document_spec.rb
mdoc-0.0.6 spec/document_spec.rb
mdoc-0.0.5 spec/document_spec.rb