Sha256: f5bfcb0e2ca248acf475fd165e95d4afd56e72646bd5c695c9ba1af4f3482f56

Contents?: true

Size: 1.92 KB

Versions: 5

Compression:

Stored size: 1.92 KB

Contents

# frozen_string_literal: true

shared_examples_for "e-book" do
  let(:mybook) { tmpdir.join("mybook") }

  it "generates e-book" do
    expect(mybook).to be_directory
  end

  it "creates images directory" do
    expect(mybook.join("images")).to be_directory
  end

  it "creates text directory" do
    expect(mybook.join("text")).to be_directory
  end

  it "creates fonts directory" do
    expect(mybook.join("fonts")).to be_directory
  end

  it "creates template directory" do
    expect(mybook.join("templates")).to be_directory
  end

  it "creates configuration file" do
    expect(mybook.join("config/kitabu.yml")).to be_file
  end

  it "creates helper file" do
    expect(mybook.join("config/helper.rb")).to be_file
  end

  it "copies sample texts" do
    expect(mybook.join("text/01_Getting_Started.md")).to be_file
    expect(mybook.join("text/02_Creating_Chapters.md")).to be_file
    expect(mybook.join("text/03_Syntax_Highlighting.md.erb")).to be_file
    expect(mybook.join("text/04_Dynamic_Content.md.erb")).to be_file
    expect(mybook.join("text/05_Exporting_Files.md")).to be_file
  end

  it "copies Guardfile" do
    expect(mybook.join("Guardfile")).to be_file
  end

  it "copies stylesheets" do
    expect(mybook.join("templates/styles")).to be_directory
    expect(mybook.join("templates/styles/epub.css")).to be_file
    expect(mybook.join("templates/styles/print.css")).to be_file
    expect(mybook.join("templates/styles/pdf.css")).to be_file
    expect(mybook.join("templates/styles/html.css")).to be_file
  end

  it "copies Gemfile" do
    expect(mybook.join("Gemfile")).to be_file
  end

  it "copies html template files" do
    expect(mybook.join("templates/html/layout.erb")).to be_file
  end

  it "copies epub template files" do
    expect(mybook.join("templates/epub/cover.erb")).to be_file
    expect(mybook.join("templates/epub/cover.png")).to be_file
    expect(mybook.join("templates/epub/page.erb")).to be_file
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kitabu-3.1.0 spec/support/shared.rb
kitabu-3.0.3 spec/support/shared.rb
kitabu-3.0.2 spec/support/shared.rb
kitabu-3.0.1 spec/support/shared.rb
kitabu-3.0.0 spec/support/shared.rb