Skip to content

Commit

Permalink
write files in epubmaker_instance
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuto committed Aug 18, 2024
1 parent cb1429f commit 6ee0389
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/test_epubmaker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,8 @@ def error(s)

Dir.chdir(tmpdir) do
Dir.mkdir('test')
File.write(File.join(tmpdir, 'test', 'ch01.html'), '<html><img src="images/ch01.png" /></html>')
File.write(File.join(tmpdir, 'test', 'style.css'), 'div { background-image: url("images/bg.jpg")}')
yield(epubmaker, File.join(tmpdir, 'test'))
end
end
Expand Down Expand Up @@ -951,11 +953,8 @@ def test_verify_target_images
epubmaker.config['coverimage'] = 'cover.png'

epubmaker.producer.contents << ReVIEW::EPUBMaker::Content.new(file: 'ch01.html', title: 'CH01', level: 1)
File.write(File.join(tmpdir, 'ch01.html'), '<html><img src="images/ch01.png" /></html>')
epubmaker.producer.contents << ReVIEW::EPUBMaker::Content.new(file: 'style.css')
File.write(File.join(tmpdir, 'style.css'), 'div { background-image: url("images/bg.jpg")}')
epubmaker.verify_target_images(tmpdir)
File.unlink(File.join(tmpdir, 'ch01.html'), File.join(tmpdir, 'style.css'))

expect = %w[images/bg.jpg images/ch01.png images/cover.png]
assert_equal expect, epubmaker.config['epubmaker']['force_include_images']
Expand Down

0 comments on commit 6ee0389

Please sign in to comment.