spec/builders/epub_spec.rb in softcover-1.1.22 vs spec/builders/epub_spec.rb in softcover-1.1.23

- old
+ new

@@ -1,11 +1,11 @@ require 'spec_helper' describe Softcover::Builders::Epub do before(:all) do generate_book - @file_to_be_removed = path('html/should_be_removed.html') + @file_to_be_removed = path('html/should_be_removed.xhtml') File.write(@file_to_be_removed, '') silence { `softcover build:epub` } @builder = Softcover::Builders::Epub.new @builder.build! end @@ -116,13 +116,13 @@ let(:doc) { Nokogiri::XML(File.read(toc)) } it { should exist } it "should contain the right filenames in the right order" do - filenames = %w[frontmatter_fragment.html a_chapter_fragment.html - another_chapter_fragment.html - yet_another_chapter_fragment.html] + filenames = %w[frontmatter_fragment.xhtml a_chapter_fragment.xhtml + another_chapter_fragment.xhtml + yet_another_chapter_fragment.xhtml] source_files = doc.css('content').map { |node| node['src'] } expect(source_files).to eql(filenames) end it "should have the right title" do @@ -148,23 +148,23 @@ expect(@file_to_be_removed).not_to exist end it "should create the HTML files" do has_math = false - expect(path('epub/OEBPS/cover.html')).to exist + expect(path('epub/OEBPS/cover.xhtml')).to exist builder.manifest.chapters.each_with_index do |chapter, i| content = File.read(path("html/#{chapter.slug}_fragment.html")) has_math ||= builder.math?(content) - fragment = path("epub/OEBPS/#{chapter.slug}_fragment.html") + fragment = path("epub/OEBPS/#{chapter.slug}_fragment.xhtml") expect(fragment).to exist end # Make sure at least one template file has math. expect(has_math).to be_true end describe "cover file" do - subject(:cover_file) { File.read(path('epub/OEBPS/cover.html')) } + subject(:cover_file) { File.read(path('epub/OEBPS/cover.xhtml')) } it "should have the right cover image" do expect(cover_file).to include 'cover.jpg' end end @@ -261,11 +261,11 @@ expect(template).to include('Foo Bar & Grill') expect(template).to include(uuid) end end - context "nav.html template" do + context "nav.xhtml template" do let(:nav_list) { [] } let(:template) do dummy_class.new.nav_html_template(title, nav_list) end @@ -276,10 +276,10 @@ end describe "article validation" do before(:all) do generate_book(markdown: true, article: true) - @file_to_be_removed = path('html/should_be_removed.html') + @file_to_be_removed = path('html/should_be_removed.xhtml') File.write(@file_to_be_removed, '') silence { `softcover build:epub` } @builder = Softcover::Builders::Epub.new @builder.build! end \ No newline at end of file