Sha256: 743e5d62ffcd40a112cde121a9e52f351eeac036e92a07a3a1f6508bce41f766

Contents?: true

Size: 1.2 KB

Versions: 9

Compression:

Stored size: 1.2 KB

Contents

require 'spec_helper'

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

    describe "#build!" do
      it "should generate the EPUB" do
        expect('ebooks/book.epub').to exist
      end

      # Because of the way kindlegen uses tempfiles, testing for the
      # actual generation of the MOBI causes an error, so we just
      # check the command.
      describe "MOBI generation" do
        subject(:built) { @built }
        it { should match /kindlegen/ }
        it { should match /ebooks\/book\.epub/ }
      end
    end
  end

  context "for a Markdown book" do
    before(:all) do
      generate_book(markdown: true)
      @builder = Softcover::Builders::Mobi.new
      @built = @builder.build!
      chdir_to_book
    end
    after(:all) { remove_book }

    describe "#build!" do
      describe "MOBI generation" do
        subject(:built) { @built }
        it { should match /kindlegen/ }
        it { should match /ebooks\/book\.epub/ }
        it { should_not match /Book.txt.epub/ }
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
softcover-0.6.7 spec/builders/mobi_spec.rb
softcover-0.6.6 spec/builders/mobi_spec.rb
softcover-0.6.5 spec/builders/mobi_spec.rb
softcover-0.6.4 spec/builders/mobi_spec.rb
softcover-0.6.3 spec/builders/mobi_spec.rb
softcover-0.6.2 spec/builders/mobi_spec.rb
softcover-0.6.1 spec/builders/mobi_spec.rb
softcover-0.6.0 spec/builders/mobi_spec.rb
softcover-0.5.0 spec/builders/mobi_spec.rb