Sha256: f52f285ad10df81612e19e17ebc02ef6167ebe7c7b74e5294eced6c990ba08a9

Contents?: true

Size: 1.1 KB

Versions: 24

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'

describe Softcover::Builders::Mobi do
  describe "#build!" do
    before(:all) do
      generate_book
      @builder = Softcover::Builders::Mobi.new
      @built = @builder.build!
      chdir_to_book
    end
    after(:all) { remove_book }

    it "should generate the MOBI" do
      expect('ebooks/book.mobi').to exist
    end

    describe "MOBI command" do
      context "default" do
        let(:command) { @builder.mobi_command(@builder.mobi_filename) }
        it "should use Calibre's ebook-convert" do
          expect(command).to include 'ebook-convert'
        end
      end

      context "kindlegen" do
        let(:command) do
          @builder.mobi_command(@builder.mobi_filename, kindlegen: true)
        end
        it "should use Amazon.com's kindlegen" do
          expect(command).to include 'kindlegen'
        end
      end

      context "preview" do
        let(:filename) do
          @builder.mobi_filename(preview: true)
        end
        it "should use Calibre's ebook-convert" do
          expect(filename).to include 'book-preview'
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
softcover-0.7.1 spec/builders/mobi_spec.rb
softcover-0.7.0 spec/builders/mobi_spec.rb
softcover-0.6.10 spec/builders/mobi_spec.rb
softcover-0.6.9 spec/builders/mobi_spec.rb