Skip to content

Commit

Permalink
write files at outside of chdir
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuto committed Aug 18, 2024
1 parent 6ee0389 commit 46f184b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/test_epubmaker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -882,10 +882,11 @@ def error(s)
Dir.mkdir(File.join(tmpdir, 'subdir'))
File.write(File.join(tmpdir, 'subdir', 'exist.html'), '<html></html>')

Dir.mkdir(File.join(tmpdir, '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")}')

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

0 comments on commit 46f184b

Please sign in to comment.