spec/builders/epub_spec.rb in softcover-1.3.2 vs spec/builders/epub_spec.rb in softcover-1.3.3
- old
+ new
@@ -12,11 +12,14 @@
after(:all) { remove_book }
subject(:builder) { @builder }
it "should be valid" do
output = `softcover epub:validate`
- expect(output).to match(/No errors or warnings/)
+ english = "No errors or warnings"
+ # I (mhartl) sometimes set my system language to Spanish.
+ spanish = "No se han detectado errores o advertencias"
+ expect(output).to match(/(#{english}|#{spanish})/)
end
describe "mimetype file" do
it "should exist in the right directory" do
expect(path('epub/mimetype')).to exist
@@ -171,10 +174,16 @@
it "should create math PNGs" do
expect(path("epub/OEBPS/images/texmath")).to exist
expect(Dir[path("epub/OEBPS/images/texmath/*.png")]).not_to be_empty
end
+ it "math PNGs shouldn't be too small (regression test for empty PNGs)" do
+ Dir[path("epub/OEBPS/images/texmath/*.png")].each do |pngfile|
+ expect(File.size(pngfile)).to be > 500
+ end
+ end
+
it "should record vertical-align of inline math SVGs" do
content = File.read(path("./epub/OEBPS/a_chapter_fragment.xhtml"))
html = Nokogiri::HTML(content)
math_imgs = html.search('span.inline_math img')
math_imgs.each do |math_img|
@@ -222,11 +231,15 @@
end
after(:all) { remove_book }
subject(:builder) { @builder }
it "should be valid" do
- expect(`softcover epub:validate`).to match(/No errors or warnings/)
+ output = `softcover epub:validate`
+ english = "No errors or warnings"
+ # I (mhartl) sometimes set my system language to Spanish.
+ spanish = "No se han detectado errores o advertencias"
+ expect(output).to match(/(#{english}|#{spanish})/)
end
it "should not raise an error" do
expect { subject }.not_to raise_error
end
@@ -305,10 +318,13 @@
after(:all) { remove_book }
subject(:builder) { @builder }
it "should be valid" do
output = `softcover epub:validate`
- expect(output).to match(/No errors or warnings/)
+ english = "No errors or warnings"
+ # I (mhartl) sometimes set my system language to Spanish.
+ spanish = "No se han detectado errores o advertencias"
+ expect(output).to match(/(#{english}|#{spanish})/)
end
it "should description" do
commands = Softcover::Commands::Deployment.default_commands
expect(commands).not_to include('preview')
\ No newline at end of file