Sha256: d11c8a742363e958e5fd2c548900b8efafcb95af4adeb0b22bf527d36df271db

Contents?: true

Size: 963 Bytes

Versions: 1

Compression:

Stored size: 963 Bytes

Contents

require 'spec_helper'

module EpubValidator
  describe ProcessEpub do
    context "when it processes a file" do
      it "should return a message" do
        message = "Epubcheck Version 1.2\n\nERROR: rspec-test.epub: resource OEBPS/stylesheets/handbookish.css is missing\n\nCheck finished with warnings or errors!"
        ec = ProcessEpub.new
        ec.stub(:epubcheck).and_return(message)
        ec.epubcheck("test.epub").should eq(message)
      end
      it "should return the output message formatted" do
        message = "Epubcheck Version 1.2\n\nERROR: book.epub: resource OEBPS/stylesheets/handbookish.css is missing\n\nCheck finished with warnings or errors!"
        formatted_message = ["ERROR: book.epub: resource OEBPS/stylesheets/handbookish.css is missing"]

        ec = ProcessEpub.new
        m = ec.format_epubcheck_output(message)
        m[:valid].should eq(0)
        m[:message].should eq(formatted_message)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
epub_validator-0.2.0 spec/epub_validator/process_epub_spec.rb