Sha256: 52649a3960f9ff1e69dc552d997b7fa460f7ce2bbf5c23102c360cca1b570513

Contents?: true

Size: 1.11 KB

Versions: 23

Compression:

Stored size: 1.11 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) do
          @builder.mobi_command(@builder.mobi_filename, calibre: true)
        end
        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)
        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 create a preview file" do
          expect(filename).to include 'book-preview'
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
softcover-0.9.23 spec/builders/mobi_spec.rb
softcover-0.9.22 spec/builders/mobi_spec.rb
softcover-0.9.21 spec/builders/mobi_spec.rb
softcover-0.9.20 spec/builders/mobi_spec.rb
softcover-0.9.19 spec/builders/mobi_spec.rb
softcover-0.9.18 spec/builders/mobi_spec.rb
softcover-0.9.17 spec/builders/mobi_spec.rb
softcover-0.9.16 spec/builders/mobi_spec.rb
softcover-0.9.15 spec/builders/mobi_spec.rb
softcover-0.9.13 spec/builders/mobi_spec.rb
softcover-0.9.12 spec/builders/mobi_spec.rb
softcover-0.9.11 spec/builders/mobi_spec.rb
softcover-0.9.10 spec/builders/mobi_spec.rb
softcover-0.9.9 spec/builders/mobi_spec.rb
softcover-0.9.8 spec/builders/mobi_spec.rb
softcover-0.9.7 spec/builders/mobi_spec.rb
softcover-0.9.6 spec/builders/mobi_spec.rb
softcover-0.9.5 spec/builders/mobi_spec.rb
softcover-0.9.4 spec/builders/mobi_spec.rb
softcover-0.9.3 spec/builders/mobi_spec.rb