Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/socket-patch-cli/src/commands/gem_refresh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1665,10 +1665,10 @@ mod tests {
`rm -f {} {} {} {} && bundle install`; another project that still pins \
the hosted patch of them then loads the upstream code, which \
`socket-patch scan` reports there.",
shell_word(&home.join("specifications/rack-1.0.0.gemspec")),
shell_word(&home.join("cache/rack-1.0.0.gem")),
shell_word(&home.join("specifications/rexml-1.0.0.gemspec")),
shell_word(&home.join("cache/rexml-1.0.0.gem")),
shell_word(&home.join("specifications").join("rack-1.0.0.gemspec")),
shell_word(&home.join("cache").join("rack-1.0.0.gem")),
shell_word(&home.join("specifications").join("rexml-1.0.0.gemspec")),
shell_word(&home.join("cache").join("rexml-1.0.0.gem")),
),
]
);
Expand Down
9 changes: 4 additions & 5 deletions crates/socket-patch-cli/tests/e2e_gem_native_ext_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3183,11 +3183,10 @@ impl JavaGem {

/// The gem file `file` as [`walk_files`] of `vendor/` names it.
fn vendor_rel(&self, file: &str) -> String {
let mut path = self
.gem_dir
.strip_prefix(self.proj.join("vendor"))
.unwrap()
.to_path_buf();
// Component by component: `gem_dir` was joined from `/` strings,
// and Windows would keep those separators where the walk has `\`.
let rel = self.gem_dir.strip_prefix(self.proj.join("vendor")).unwrap();
let mut path: PathBuf = rel.components().collect();
path.extend(file.split('/'));
path.display().to_string()
}
Expand Down
15 changes: 13 additions & 2 deletions crates/socket-patch-cli/tests/get/get_update_summary_e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ async fn mount_mocks(mock: &MockServer) {
.await;
}

/// The manifest as the save line names it: the default `--cwd` (`.`) joined
/// with the default manifest path, so `./.socket/manifest.json` on Unix and
/// `.\.socket/manifest.json` on Windows.
fn manifest_label() -> String {
std::path::Path::new(".")
.join(".socket/manifest.json")
.display()
.to_string()
}

/// Run `get <PURL> --save-only` against `mock`, returning `(code, stdout, stderr)`.
fn run_get(cwd: &std::path::Path, uri: &str) -> (i32, String, String) {
common::run(
Expand Down Expand Up @@ -122,7 +132,8 @@ async fn replacing_a_manifest_entry_is_reported_as_updated_only() {
assert!(
stderr.ends_with(&format!(
" [update] {PURL} (replacing 00000000)\n\
Saved 1 patch to ./.socket/manifest.json (1 updated).\n"
Saved 1 patch to {} (1 updated).\n",
manifest_label()
)),
"the replacement must be reported as one saved patch, an update, never also an add; \
stdout={stdout}\nstderr={stderr}"
Expand All @@ -148,7 +159,7 @@ async fn a_brand_new_entry_is_still_reported_as_added() {
assert_eq!(code, 0, "save-only add must succeed; stderr={stderr}");

assert!(
stderr.ends_with("Saved 1 patch to ./.socket/manifest.json.\n"),
stderr.ends_with(&format!("Saved 1 patch to {}.\n", manifest_label())),
"a new entry must be reported as one saved patch; stdout={stdout}\nstderr={stderr}"
);
assert!(
Expand Down
Loading