Sha256: 8b0787bced6f4a548ab89b68d6fa0a10e5f3516ff19cf47da544bff7bd0ce8b3

Contents?: true

Size: 764 Bytes

Versions: 3

Compression:

Stored size: 764 Bytes

Contents

require 'spec_helper'
require 'nokogiri'

describe Fdoc::SchemaPresenter do
  let(:schema) {
    {
      'description' => 'Some description text',
      'example' => 'an example'
    }
  }
  subject {
    Fdoc::SchemaPresenter.new(schema, {})
  }

  context '#to_html' do
    it 'should generate valid HTML' do
      html = subject.to_html

      html.should include 'Some description text'
      html.should include 'an example'
      expect {
        Nokogiri::HTML(html) { |config| config.strict }
      }.to_not raise_exception
    end
  end

  context "#to_markdown" do
    it "should generate markdown" do
      markdown = subject.to_markdown
      markdown.should include 'Some description text'
      markdown.should include 'an example'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fdoc-0.3.3 spec/fdoc/presenters/schema_presenter_spec.rb
fdoc-0.3.2 spec/fdoc/presenters/schema_presenter_spec.rb
fdoc-0.3.1 spec/fdoc/presenters/schema_presenter_spec.rb