Sha256: 9c73c651c9d5c95f9f22cbd11a80b117db5bf3fa5aad35cd74d9e32673a734dc

Contents?: true

Size: 921 Bytes

Versions: 4

Compression:

Stored size: 921 Bytes

Contents

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
brief-0.0.5 spec/lib/brief/document_spec.rb
brief-0.0.4 spec/lib/brief/document_spec.rb
brief-0.0.3 spec/lib/brief/document_spec.rb
brief-0.0.2 spec/lib/brief/document_spec.rb