17 Commits
Author SHA1 Message Date
Nobuyoshi Nakada e2a743242a Separate test-spec tmpdir
spec/mspec/lib/mspec/helpers/tmp.rb also tries to remove SPEC_TEMP_DIR
at exit, before this `END`.  At that time, the "tmp" marker directory
causes an ENOTEMPTY.
2026-06-30 14:29:24 +09:00
Hiroshi SHIBATAandClaude Opus 4.8 1bcc15d1d8 Remove the tmp marker before removing the temp root
The sandbox marker created at the temp root is ours, so the END block
must remove it before Dir.rmdir(tmpdir); otherwise that call always
fails with ENOTEMPTY and a clean run looks like it left files behind.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 11:45:53 +09:00
Hiroshi SHIBATAandClaude Opus 4.8 888f6e07f2 Keep bundler specs in their sandbox when temp is under the user home
Bundler's spec helpers walk up from the working directory looking for a
`.bundle` directory, stopping at the first ancestor that contains a `tmp`
directory (Bundler::SharedHelpers#search_up). On Windows the test temp dir
lives under the user home (%LOCALAPPDATA%\Temp), so the search escaped the
sandbox and picked up the real ~/.bundle, breaking config, cache and other
specs. Create a `tmp` marker at the temp root so the search stops there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 11:45:53 +09:00
Takashi Kokubun ec2ff4fc48 Remove unnecessary begin/end in do/end block in _tmpdir.rb 2026-03-27 11:27:30 -07:00
Takashi Kokubun 3588198cb0 Fix EACCES error during tmpdir cleanup on Windows (#16577)
On Windows, when a test process is killed after a timeout, the OS may
not release file/directory handles immediately. The Dir.rmdir in the
diagnostic tree-walk raises Errno::EACCES, which was unhandled, causing
the entire cleanup to abort before FileUtils.rm_rf could run.

Rescue EACCES in the best-effort tree cleanup so it falls through to
FileUtils.rm_rf which handles this more robustly.
2026-03-26 23:34:08 -07:00
Nobuyoshi Nakada 986aa6943f Suppress an uninitialized variable warning 2026-02-20 19:44:00 +09:00
Nobuyoshi Nakada 4ab288f9d4 Clean temporary files generated by test-bundler 2026-02-18 10:16:51 +09:00
Tim Smith 3cfd71e7e4 Fix minor typos in comments, specs, and docs
Just a bit of minor cleanup

Signed-off-by: Tim Smith <tsmith84@gmail.com>
2025-06-18 07:51:16 +09:00
Nobuyoshi Nakada a53435868e Traverse tmpdir under chdir 2024-04-23 13:38:40 +09:00
Nobuyoshi Nakada 777daae049 Shorten tmpdir path 2024-04-23 13:38:39 +09:00
Nobuyoshi Nakada d42a8d6602 [DOC] Tweek a comment 2024-04-22 13:00:19 +09:00
Nobuyoshi Nakada 44d2b59491 Extract list_tree as a method and separate from removals 2024-04-22 13:00:19 +09:00
Nobuyoshi Nakada c65bc2e5d9 Show left tmpdir recursively 2024-04-22 13:00:19 +09:00
Nobuyoshi Nakada e59da9c339 Windows does not have "/tmp" path usually 2024-04-22 09:56:47 +09:00
Nobuyoshi Nakada 9f9755664d Fix method name 2024-04-20 11:34:52 +09:00
Nobuyoshi Nakada cd95f6b87f Show left files info 2024-04-19 23:17:23 +09:00
Nobuyoshi Nakada c789e4c493 Use isolated temporary directory in test-all too for RubyGems tests 2024-04-19 23:06:46 +09:00