Sha256: 9e9b57e4edb0ccba7937a7ca96f11ab2a12c09ca6ba2f3564c07c864f3dec9aa

Contents?: true

Size: 658 Bytes

Versions: 3

Compression:

Stored size: 658 Bytes

Contents

require 'spec_helper'

module Gram
  module Blog
    describe Parser do
      
      describe ".parse" do
        it 'converts a file into a hash' do
          file = double :file
          raw = """
---
title: My title
tagline: My tagline
published: false
---

#My post
#
Blah
          """
          File.stub(:read).with(file).and_return raw

          subject.parse(file).should == { 'title' => 'My title',
                                          'tagline' => 'My tagline',
                                          'published' => false,
                                          'body' => "#My post\n#\nBlah"}
        end
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gram-0.3.0 spec/gram/blog/parser_spec.rb
gram-0.2.0 spec/gram/blog/parser_spec.rb
gram-0.1.0 spec/gram/blog/parser_spec.rb