Skip to content

Commit 992f9bf

Browse files
committed
Fix(doctest): Ensure tmp/doctests/src directory exists and clean tmp/doctests before run
The doctest rake task was failing because the 'tmp/doctests/src' directory was not explicitly created before attempting to write files into it, leading to 'No such file or directory' errors. This commit addresses the issue by: 1. Adding to ensure the subdirectory is created. 2. Adding at the beginning of the task to clean the directory before each run, ensuring a consistent and clean testing environment.
1 parent e8a763c commit 992f9bf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

rakelib/doctest.rake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ namespace :doctest do
77
desc "Run documentation code examples tests"
88
task :run do
99
test_dir = "tmp/doctests"
10+
FileUtils.rm_rf(test_dir)
1011
src_dir = File.join(test_dir, "src")
12+
FileUtils.mkdir_p(src_dir)
1113
puts "--- Created temporary directory for doctests at #{test_dir} ---"
1214

1315
files_to_check = ENV["FILE"] ? [ENV["FILE"]] : Dir.glob("docsite/docs/**/*.{mdx,md}")

0 commit comments

Comments
 (0)