require 'spec_helper' describe Mdoc::Text do context "pandoc format" do subject(:mf) { Mdoc::Text.new('examples/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') } its(:body) { should match('The Third line of contents') } its(:body) { should eq("The first line of contents\r\n\r\nThe Third line of contents\r\n")} end context "original format" do subject(:mf) { Mdoc::Text.new('examples/original.md') } its(:title) { should eq('The title for our document') } its(:author) { should eq('unknown person') } its(:date) { should eq('2009-08-01') } its(:body) { should eq("\r\nThe content inside\r\n")} end context "multi-key format" do subject(:mf) { Mdoc::Text.new('examples/multikeys.md') } its(:title) { should eq('The title for our document') } its(:author) { should eq('unknown person') } its(:date) { should eq('2009-08-01') } its(:body) { should match("The content inside")} end end