Sha256: 0ab79d696faaed1cb2e754247c11badf5b789c83a5bef120777099274bf41b6c

Contents?: true

Size: 865 Bytes

Versions: 4

Compression:

Stored size: 865 Bytes

Contents

require 'spec_helper'

describe Rack::Blogengine::Document do
  before do
    @document = Rack::Blogengine::Document.new

    @document.title = 'testtitle'
    @document.path = '/test'
    @document.date = '20-20-2014'
    @document.html = '<html><h1>Test</h1></html>'
  end

  describe '#new' do
    it 'should be an instance of Document' do
      @document.class.must_equal Rack::Blogengine::Document
    end

    it 'should have content when parsed in' do
      @document.title.must_equal 'testtitle'
      @document.path.must_equal '/test'
      @document.date.must_equal '20-20-2014'
      @document.html.must_equal '<html><h1>Test</h1></html>'
    end
  end

  describe '#to_hash' do
    it 'should return the right hash' do
      hashed = @document.to_hash

      hashed.key?(:path).must_equal true
      hashed.key?(:html).must_equal true
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rack-blogengine-0.2.5 spec/rack/blogengine/document_spec.rb
rack-blogengine-0.2.4 spec/rack/blogengine/document_spec.rb
rack-blogengine-0.2.3 spec/rack/blogengine/document_spec.rb
rack-blogengine-0.2.2 spec/rack/blogengine/document_spec.rb