Sha256: 2c86b272c2096b3334f61f8afc25cd413e7b04cf285384bb7ae5d6544605009d

Contents?: true

Size: 905 Bytes

Versions: 1

Compression:

Stored size: 905 Bytes

Contents

require "spec_helper"

describe Kitabu::Exporter::HTML do
  let(:root) { SPECDIR.join("support/mybook") }
  let(:format) { described_class.new(root) }

  context "when generating HTML" do
    let(:file) { SPECDIR.join("support/mybook/output/mybook.html") }
    let(:html) { File.read(file) }
    before { format.export }

    it "keeps html file around" do
      expect(file).to be_file
    end

    it "has several chapters" do
      expect(html).to have_tag("div.chapter", 3)
    end

    it "uses config file" do
      expect(html).to have_tag("div.imprint p", "Copyright (C) 2010 John Doe.")
    end

    it "renders changelog" do
      expect(html).to have_tag("div.changelog h2", "Revisions")
    end

    it "renders erb" do
      expect(html).to have_tag("h2", "ERB")
    end

    it "renders erb blocks" do
      expect(html).to have_tag("div.note.info > p", "This is a note!")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kitabu-2.0.1 spec/kitabu/exporter/html_spec.rb