require "spec_helper" describe Brief::Document do let(:path) { Brief.fixtures.join("sample.md") } let(:tutorial) do Brief::Document.new(path: path) end it "should let me pass raw markdown" do level_one = Brief::Document.new(path.read).tree.level(1) expect(level_one.first.title).to eq("Heading One") end it "should let me pass a markdown file" do level_one = Brief::Document.new(path).tree.level(1) expect(level_one.first.title).to eq("Heading One") end describe "Parsers and Publishers" do it "should have a parser" do expect(tutorial.parser).not_to be_nil end it "should have a publisher" do expect(tutorial.publisher).not_to be_nil end end describe "Finding code blocks by language" do it "should find the blocks of code and group them by their language" do expect(tutorial.code_blocks_by_language).not_to be_empty end end end