Sha256: b48f8fe82e7b213fbd3b6f708927e8281e5906a190e33ef9fa14c4616b559261

Contents?: true

Size: 1.89 KB

Versions: 2

Compression:

Stored size: 1.89 KB

Contents

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.erb")).to be_file
    expect(mybook.join("text/04_Dynamic_Content.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.scss")).to be_file
    expect(mybook.join("templates/styles/print.scss")).to be_file
    expect(mybook.join("templates/styles/pdf.scss")).to be_file
    expect(mybook.join("templates/styles/html.scss")).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

2 entries across 2 versions & 1 rubygems

Version Path
kitabu-2.1.0 spec/support/shared.rb
kitabu-2.0.4 spec/support/shared.rb