Sha256: adee6d1b8e5028af63d678c9f16ebe230a9002c1a4652b2eff93c59b3500bfc9

Contents?: true

Size: 680 Bytes

Versions: 2

Compression:

Stored size: 680 Bytes

Contents

require "spec_helper"

describe "The Brief Document" do
  let(:sample) do
    path = Brief.example_path.join("docs","epic.html.md")
    Brief::Document.new(path)
  end

  it "renders html" do
    expect(sample.to_html).to include("<h1>User Stories</h1>")
  end

  it "parses the html" do
    expect(sample.css("h1").length).to eq(2)
  end

  it "deserializes YAML frontmatter into attributes" do
    expect(sample.frontmatter.type).to eq("epic")
  end

  context "Content Extraction" do
    it "extracts content from a css selector" do
      extracted = sample.extract_content(:args => ["h1:first-child"])
      expect(extracted).to eq("Blueprint Epic Example")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
brief-1.1.0 spec/lib/brief/document_spec.rb
brief-1.0.0 spec/lib/brief/document_spec.rb