summaryrefslogtreecommitdiff
path: root/spec/image_spec.rb
diff options
context:
space:
mode:
authorMarat Radchenko <marat@slonopotamus.org>2020-03-01 16:21:27 +0300
committerGitHub <noreply@github.com>2020-03-01 16:21:27 +0300
commit62b0405ecbf2ae01eeba2bc69f093bc17b152f7a (patch)
tree8bc9ac1824e03e05f666285bdea7f42ad8e01b73 /spec/image_spec.rb
parenta377be4ddcb25849bf363133e8f013e971585570 (diff)
Add support for heredoc documents in test suite (PR #313)
Diffstat (limited to 'spec/image_spec.rb')
-rw-r--r--spec/image_spec.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/image_spec.rb b/spec/image_spec.rb
index 9d3dcab..af2c6b7 100644
--- a/spec/image_spec.rb
+++ b/spec/image_spec.rb
@@ -5,7 +5,7 @@ require 'asciidoctor-diagram'
describe 'Asciidoctor::Epub3::Converter - Image' do
it 'supports imagesoutdir != imagesdir != "{base_dir}/images"' do
- book, out_file = to_epub 'diagram/book.adoc'
+ book, out_file = to_epub fixture_file('diagram/book.adoc')
out_dir = out_file.dirname
expect(out_dir.join('a', 'a.png')).to exist
@@ -20,7 +20,7 @@ describe 'Asciidoctor::Epub3::Converter - Image' do
end
it 'supports inline images' do
- book, out_file = to_epub 'inline-image/book.adoc'
+ book, out_file = to_epub fixture_file('inline-image/book.adoc')
out_dir = out_file.dirname
expect(out_dir.join('imagez', 'inline-diag.png')).to exist
@@ -31,14 +31,14 @@ describe 'Asciidoctor::Epub3::Converter - Image' do
end
it 'converts font-based icons to CSS' do
- book, = to_epub 'icon/book.adoc'
+ book, = to_epub fixture_file('icon/book.adoc')
chapter = book.item_by_href '_chapter.xhtml'
expect(chapter).not_to be_nil
expect(chapter.content).to include '.i-commenting::before { content: "\f4ad"; }'
end
it 'adds front cover image' do
- book, = to_epub 'front-cover-image/book.adoc'
+ book, = to_epub fixture_file('front-cover-image/book.adoc')
cover_image = book.item_by_href 'jacket/cover.png'
expect(cover_image).not_to be_nil
cover_page = book.item_by_href 'cover.xhtml'
@@ -47,7 +47,7 @@ describe 'Asciidoctor::Epub3::Converter - Image' do
end
it 'supports image width/height' do
- book, = to_epub 'image-dimensions/book.adoc'
+ book, = to_epub fixture_file('image-dimensions/book.adoc')
chapter = book.item_by_href '_chapter.xhtml'
expect(chapter).not_to be_nil
expect(chapter.content).to include '<img src="square.png" alt="100x100" width="100" />'
@@ -57,7 +57,7 @@ describe 'Asciidoctor::Epub3::Converter - Image' do
# If this test fails for you, make sure you're using gepub >= 1.0.11
it 'adds SVG attribute to EPUB manifest if chapter contains SVG images' do
- book, = to_epub 'svg/book.adoc'
+ book, = to_epub fixture_file('svg/book.adoc')
chapter = book.item_by_href '_chapter.xhtml'
expect(chapter).not_to be_nil
properties = chapter['properties']