Sha256: dd5d5b8843241bed149b1a6fce50ebe4e21443ed326eb51b7b255da89623aaa4

Contents?: true

Size: 510 Bytes

Versions: 4

Compression:

Stored size: 510 Bytes

Contents

require 'spec_helper'

module FrontMatterParser
  describe Parsed do

    let(:sample) { {'title' => 'hello'} }

    let(:string) { %Q(
---
title: hello
---
Content) }

    let(:parsed) { FrontMatterParser.parse(string) }

    describe "#to_hash" do
      it "returns @front_matter" do
        expect(parsed.to_hash).to eq(sample)
      end
    end

    describe "#[]" do
      it "returns the front matter value for the given key" do
        expect(parsed['title']).to eq('hello')
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
front_matter_parser-0.0.4 spec/front_matter_parser/parsed_spec.rb
front_matter_parser-0.0.3 spec/front_matter_parser/parsed_spec.rb
front_matter_parser-0.0.2 spec/front_matter_parser/parsed_spec.rb
front_matter_parser-0.0.1 spec/front_matter_parser/parsed_spec.rb