Skip to content

Commit e116787

Browse files
committed
Tighten the gem refresh label test and docs
Review follow-ups: the installed file is reset before each pass, so the second pass also proves the staged install replaced it, and the doc comments name every unwind, not only rollback and remove. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011f9aeNXZ8oGYWanAWxsCiy Assisted-by: Claude Code:claude-fable-5-2
1 parent 451db64 commit e116787

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎crates/socket-patch-core/src/patch/gem_ext.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@ fn took(elapsed: Duration) -> String {
16231623
}
16241624

16251625
/// Run a build of `copy`'s extension (`run`, `from`: "its source gem with
1626-
/// the patch applied", "its patched gem"), saying when it starts and how it
1626+
/// the patch applied", "its upstream gem"), saying when it starts and how it
16271627
/// ended
16281628
/// ([`RubyEnv::progress`]). What the build was worth is the caller's to
16291629
/// say: one that exits cleanly may still have built nothing of the patch.
@@ -2547,8 +2547,8 @@ fn parse_installed(stdout: &str) -> Option<(String, PathBuf)> {
25472547
/// rebuild ([`find_ruby`]): the one whose extension dir for the gem is the
25482548
/// installed one, so the staged build has the installed build's platform
25492549
/// and ABI. `kind` says which gem `archive` is, for the build's progress
2550-
/// line: `patched`, or `upstream` when `rollback` or `remove` puts that
2551-
/// one back (#2152). `Err` says why there is no staged install to use.
2550+
/// line: `patched`, or `upstream` when an unwind puts that one back
2551+
/// (#2152). `Err` says why there is no staged install to use.
25522552
pub(crate) async fn install_staged(
25532553
installed: &Path,
25542554
archive: &Path,

‎crates/socket-patch-core/src/patch/gem_refresh.rs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,8 +1132,8 @@ mod tests {
11321132
}
11331133

11341134
/// The progress line of a native gem's staged build names the gem
1135-
/// that is built (#2152): `rollback` and `remove` build the upstream
1136-
/// gem, and the line said "from its patched gem" for them as well.
1135+
/// that is built (#2152): an unwind (`rollback`, `remove`) builds the
1136+
/// upstream gem, and the line said "from its patched gem" for it too.
11371137
#[cfg(unix)]
11381138
#[tokio::test]
11391139
async fn a_native_build_names_the_gem_it_builds() {
@@ -1198,6 +1198,7 @@ mod tests {
11981198
..wanted(&new, &[&source])
11991199
};
12001200
let targets = [Target::Installed(gem_dir.clone())];
1201+
std::fs::write(gem_dir.join("lib/rack.rb"), "INSTALLED\n").unwrap();
12011202
// A sibling test forking while the script was being written
12021203
// holds its write fd until it execs: ETXTBSY (os error 26).
12031204
let out = loop {

0 commit comments

Comments
 (0)