Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

Refactor integration tests to use inline snapshots

Maximilian Roosa857c039b21b
diff --git a/tests/integration_tests/completion.rs b/tests/integration_tests/completion.rs
index cbbb17d54..9acbbfc04 100644
--- a/tests/integration_tests/completion.rs
+++ b/tests/integration_tests/completion.rs
@@ -1,5 +1,7 @@
use crate::common::TestRepo;
use assert_cmd::Command;
+use insta::Settings;
+use insta_cmd::{assert_cmd_snapshot, get_cargo_bin};
use std::process::Command as StdCommand;
#[test]
@@ -169,50 +171,89 @@ fn test_complete_base_flag_shows_all_branches() {
}
#[test]
-fn test_complete_edge_cases_return_empty() {
- // Test 1: Outside git repo
+fn test_complete_outside_git_repo() {
let temp = tempfile::tempdir().unwrap();
- let mut cmd = Command::cargo_bin("wt").unwrap();
- let output = cmd
- .current_dir(temp.path())
- .args(["complete", "wt", "switch", ""])
- .output()
- .unwrap();
- assert!(output.status.success());
- assert_eq!(String::from_utf8_lossy(&output.stdout).trim(), "");
+ let mut settings = Settings::clone_current();
+ settings.set_snapshot_path("../snapshots");
+
+ settings.bind(|| {
+ let mut cmd = StdCommand::new(get_cargo_bin("wt"));
+ cmd.current_dir(temp.path())
+ .args(["complete", "wt", "switch", ""]);
+
+ assert_cmd_snapshot!(cmd, @r"
+ success: true
+ exit_code: 0
+ ----- stdout -----
+
+ ----- stderr -----
+ ");
+ });
+}
- // Test 2: Empty repo (no commits)
+#[test]
+fn test_complete_empty_repo() {
let repo = TestRepo::new();
- let mut cmd = Command::cargo_bin("wt").unwrap();
- let output = cmd
- .current_dir(repo.root_path())
- .args(["complete", "wt", "switch", ""])
- .output()
- .unwrap();
- assert!(output.status.success());
- assert_eq!(String::from_utf8_lossy(&output.stdout).trim(), "");
+ let mut settings = Settings::clone_current();
+ settings.set_snapshot_path("../snapshots");
+
+ settings.bind(|| {
+ let mut cmd = StdCommand::new(get_cargo_bin("wt"));
+ cmd.current_dir(repo.root_path())
+ .args(["complete", "wt", "switch", ""]);
+
+ assert_cmd_snapshot!(cmd, @r"
+ success: true
+ exit_code: 0
+ ----- stdout -----
+
+ ----- stderr -----
+ ");
+ });
+}
- // Test 3: Unknown command
+#[test]
+fn test_complete_unknown_command() {
let repo = TestRepo::new();
repo.commit("initial");
- let mut cmd = Command::cargo_bin("wt").unwrap();
- let output = cmd
- .current_dir(repo.root_path())
- .args(["complete", "wt", "unknown-command", ""])
- .output()
- .unwrap();
- assert!(output.status.success());
- assert_eq!(String::from_utf8_lossy(&output.stdout).trim(), "");
+ let mut settings = Settings::clone_current();
+ settings.set_snapshot_path("../snapshots");
+
+ settings.bind(|| {
+ let mut cmd = StdCommand::new(get_cargo_bin("wt"));
+ cmd.current_dir(repo.root_path())
+ .args(["complete", "wt", "unknown-command", ""]);
+
+ assert_cmd_snapshot!(cmd, @r"
+ success: true
+ exit_code: 0
+ ----- stdout -----
+
+ ----- stderr -----
+ ");
+ });
+}
- // Test 4: Commands that don't take branch arguments (list)
- let mut cmd = Command::cargo_bin("wt").unwrap();
- let output = cmd
- .current_dir(repo.root_path())
- .args(["complete", "wt", "list", ""])
- .output()
- .unwrap();
- assert!(output.status.success());
- assert_eq!(String::from_utf8_lossy(&output.stdout).trim(), "");
+#[test]
+fn test_complete_list_command() {
+ let repo = TestRepo::new();
+ repo.commit("initial");
+ let mut settings = Settings::clone_current();
+ settings.set_snapshot_path("../snapshots");
+
+ settings.bind(|| {
+ let mut cmd = StdCommand::new(get_cargo_bin("wt"));
+ cmd.current_dir(repo.root_path())
+ .args(["complete", "wt", "list", ""]);
+
+ assert_cmd_snapshot!(cmd, @r"
+ success: true
+ exit_code: 0
+ ----- stdout -----
+
+ ----- stderr -----
+ ");
+ });
}
#[test]
diff --git a/tests/integration_tests/config_list.rs b/tests/integration_tests/config_list.rs
index e75f9742e..7119f8843 100644
--- a/tests/integration_tests/config_list.rs
+++ b/tests/integration_tests/config_list.rs
@@ -55,7 +55,25 @@ server = "npm run dev"
.env("HOME", temp_home.path())
.current_dir(repo.root_path());
- assert_cmd_snapshot!("config_list_with_project", cmd);
+ assert_cmd_snapshot!(cmd, @r#"
+ success: true
+ exit_code: 0
+ ----- stdout -----
+ Global Config: [TEMP_HOME]/.config/worktrunk/config.toml
+   worktree-path = "../{main-worktree}.{branch}"
+  
+   [[approved-commands]]
+   project = "test-project"
+   command = "npm install"
+
+ Project Config: [REPO]/.config/wt.toml
+   post-create-command = "npm install"
+  
+   [post-start-command]
+   server = "npm run dev"
+
+ ----- stderr -----
+ "#);
});
}
@@ -91,7 +109,18 @@ fn test_config_list_no_project_config() {
.env("HOME", temp_home.path())
.current_dir(repo.root_path());
- assert_cmd_snapshot!("config_list_no_project", cmd);
+ assert_cmd_snapshot!(cmd, @r#"
+ success: true
+ exit_code: 0
+ ----- stdout -----
+ Global Config: [TEMP_HOME]/.config/worktrunk/config.toml
+   worktree-path = "../{main-worktree}.{branch}"
+
+ Project Config: [REPO]/.config/wt.toml
+ πŸ’‘ Not found
+
+ ----- stderr -----
+ "#);
});
}
@@ -125,6 +154,16 @@ fn test_config_list_outside_git_repo() {
.env("HOME", temp_home.path())
.current_dir(temp_dir.path());
- assert_cmd_snapshot!("config_list_outside_repo", cmd);
+ assert_cmd_snapshot!(cmd, @r#"
+ success: true
+ exit_code: 0
+ ----- stdout -----
+ Global Config: [TEMP_HOME]/.config/worktrunk/config.toml
+ worktree-path = "../{main-worktree}.{branch}"
+
+ Project Config: Not in a git repository
+
+ ----- stderr -----
+ "#);
});
}
diff --git a/tests/integration_tests/configure_shell.rs b/tests/integration_tests/configure_shell.rs
index eed16cf50..95f115129 100644
--- a/tests/integration_tests/configure_shell.rs
+++ b/tests/integration_tests/configure_shell.rs
@@ -27,7 +27,19 @@ fn test_configure_shell_with_yes() {
.env("HOME", temp_home.path())
.current_dir(repo.root_path());
- assert_cmd_snapshot!("configure_shell_with_yes", cmd);
+ assert_cmd_snapshot!(cmd, @r#"
+ success: true
+ exit_code: 0
+ ----- stdout -----
+ Added zsh [TEMP_HOME]/.zshrc
+   if command -v wt >/dev/null 2>&1; then eval "$(wt init zsh)"; fi
+
+ βœ… Configured 1 shell
+
+ πŸ’‘ Restart your shell or run: source <config-file>
+
+ ----- stderr -----
+ "#);
});
// Verify the file was modified
@@ -59,7 +71,19 @@ fn test_configure_shell_specific_shell() {
.env("HOME", temp_home.path())
.current_dir(repo.root_path());
- assert_cmd_snapshot!("configure_shell_zsh", cmd);
+ assert_cmd_snapshot!(cmd, @r#"
+ success: true
+ exit_code: 0
+ ----- stdout -----
+ Added zsh [TEMP_HOME]/.zshrc
+   if command -v wt >/dev/null 2>&1; then eval "$(wt init zsh)"; fi
+
+ βœ… Configured 1 shell
+
+ πŸ’‘ Restart your shell or run: source <config-file>
+
+ ----- stderr -----
+ "#);
});
// Verify the file was modified
@@ -95,7 +119,14 @@ fn test_configure_shell_already_exists() {
.env("HOME", temp_home.path())
.current_dir(repo.root_path());
- assert_cmd_snapshot!("configure_shell_already_exists", cmd);
+ assert_cmd_snapshot!(cmd, @r"
+ success: true
+ exit_code: 0
+ ----- stdout -----
+ βœ… All shells already configured
+
+ ----- stderr -----
+ ");
});
// Verify the file was not modified (no duplicate)
@@ -134,7 +165,19 @@ fn test_configure_shell_custom_prefix() {
.env("HOME", temp_home.path())
.current_dir(repo.root_path());
- assert_cmd_snapshot!("configure_shell_custom_prefix", cmd);
+ assert_cmd_snapshot!(cmd, @r#"
+ success: true
+ exit_code: 0
+ ----- stdout -----
+ Added bash [TEMP_HOME]/.bash_profile
+   if command -v worktree >/dev/null 2>&1; then eval "$(worktree init bash)"; fi
+
+ βœ… Configured 1 shell
+
+ πŸ’‘ Restart your shell or run: source <config-file>
+
+ ----- stderr -----
+ "#);
});
// Verify the file has the custom prefix
@@ -162,7 +205,19 @@ fn test_configure_shell_fish() {
.env("HOME", temp_home.path())
.current_dir(repo.root_path());
- assert_cmd_snapshot!("configure_shell_fish", cmd);
+ assert_cmd_snapshot!(cmd, @r"
+ success: true
+ exit_code: 0
+ ----- stdout -----
+ Created fish [TEMP_HOME]/.config/fish/conf.d/wt.fish
+   if type -q wt; wt init fish | source; end
+
+ βœ… Configured 1 shell
+
+ πŸ’‘ Restart your shell or run: source <config-file>
+
+ ----- stderr -----
+ ");
});
// Verify the fish conf.d file was created
@@ -195,7 +250,14 @@ fn test_configure_shell_no_files() {
.env("HOME", temp_home.path())
.current_dir(repo.root_path());
- assert_cmd_snapshot!("configure_shell_no_files", cmd);
+ assert_cmd_snapshot!(cmd, @r"
+ success: false
+ exit_code: 1
+ ----- stdout -----
+
+ ----- stderr -----
+ No shell config files found in $HOME. Checked: [TEMP_HOME]/.bash_profile, [TEMP_HOME]/.profile, [TEMP_HOME]/.zshrc, and more. Create a config file or use --shell to specify a shell.
+ ");
});
}
@@ -221,7 +283,19 @@ fn test_configure_shell_fish_custom_prefix() {
.env("HOME", temp_home.path())
.current_dir(repo.root_path());
- assert_cmd_snapshot!("configure_shell_fish_custom_prefix", cmd);
+ assert_cmd_snapshot!(cmd, @r"
+ success: true
+ exit_code: 0
+ ----- stdout -----
+ Created fish [TEMP_HOME]/.config/fish/conf.d/worktree.fish
+   if type -q worktree; worktree init fish | source; end
+
+ βœ… Configured 1 shell
+
+ πŸ’‘ Restart your shell or run: source <config-file>
+
+ ----- stderr -----
+ ");
});
// Verify the fish conf.d file was created with correct prefix in filename
@@ -267,7 +341,21 @@ fn test_configure_shell_multiple_configs() {
.env("HOME", temp_home.path())
.current_dir(repo.root_path());
- assert_cmd_snapshot!("configure_shell_multiple_configs", cmd);
+ assert_cmd_snapshot!(cmd, @r#"
+ success: true
+ exit_code: 0
+ ----- stdout -----
+ Added bash [TEMP_HOME]/.bash_profile
+   if command -v wt >/dev/null 2>&1; then eval "$(wt init bash)"; fi
+ Added zsh [TEMP_HOME]/.zshrc
+   if command -v wt >/dev/null 2>&1; then eval "$(wt init zsh)"; fi
+
+ βœ… Configured 2 shells
+
+ πŸ’‘ Restart your shell or run: source <config-file>
+
+ ----- stderr -----
+ "#);
});
// Verify both files were modified
@@ -318,7 +406,21 @@ fn test_configure_shell_mixed_states() {
.env("HOME", temp_home.path())
.current_dir(repo.root_path());
- assert_cmd_snapshot!("configure_shell_mixed_states", cmd);
+ assert_cmd_snapshot!(cmd, @r#"
+ success: true
+ exit_code: 0
+ ----- stdout -----
+ Already configured bash [TEMP_HOME]/.bash_profile
+   if command -v wt >/dev/null 2>&1; then eval "$(wt init bash)"; fi
+ Added zsh [TEMP_HOME]/.zshrc
+   if command -v wt >/dev/null 2>&1; then eval "$(wt init zsh)"; fi
+
+ βœ… Configured 1 shell
+
+ πŸ’‘ Restart your shell or run: source <config-file>
+
+ ----- stderr -----
+ "#);
});
// Verify bash was not modified (already configured)
diff --git a/tests/integration_tests/directives.rs b/tests/integration_tests/directives.rs
index f8fef2bad..9f7e70e15 100644
--- a/tests/integration_tests/directives.rs
+++ b/tests/integration_tests/directives.rs
@@ -23,7 +23,14 @@ fn test_switch_internal_directive() {
.arg("my-feature")
.current_dir(repo.root_path());
- assert_cmd_snapshot!("switch_internal_directive", cmd);
+ assert_cmd_snapshot!(cmd, @r"
+ success: false
+ exit_code: 1
+ ----- stdout -----
+
+ ----- stderr -----
+ Failed to create worktree: fatal: invalid reference: my-feature
+ ");
});
}
@@ -43,7 +50,14 @@ fn test_switch_without_internal() {
.arg("my-feature")
.current_dir(repo.root_path());
- assert_cmd_snapshot!("switch_without_internal", cmd);
+ assert_cmd_snapshot!(cmd, @r"
+ success: false
+ exit_code: 1
+ ----- stdout -----
+
+ ----- stderr -----
+ Failed to create worktree: fatal: invalid reference: my-feature
+ ");
});
}
@@ -66,7 +80,18 @@ fn test_remove_internal_directive() {
.arg("remove")
.current_dir(repo.root_path());
- assert_cmd_snapshot!("remove_internal_directive", cmd);
+ assert_cmd_snapshot!(cmd, @r"
+ success: false
+ exit_code: 1
+ ----- stdout -----
+
+ ----- stderr -----
+ fatal: 'origin' does not appear to be a git repository
+ fatal: Could not read from remote repository.
+
+ Please make sure you have the correct access rights
+ and the repository exists.
+ ");
});
}
@@ -84,7 +109,18 @@ fn test_remove_without_internal() {
repo.clean_cli_env(&mut cmd);
cmd.arg("remove").current_dir(repo.root_path());
- assert_cmd_snapshot!("remove_without_internal", cmd);
+ assert_cmd_snapshot!(cmd, @r"
+ success: false
+ exit_code: 1
+ ----- stdout -----
+
+ ----- stderr -----
+ fatal: 'origin' does not appear to be a git repository
+ fatal: Could not read from remote repository.
+
+ Please make sure you have the correct access rights
+ and the repository exists.
+ ");
});
}
@@ -137,7 +173,7 @@ fn test_merge_internal_keep() {
.arg("--keep")
.current_dir(&feature_wt);
- assert_cmd_snapshot!("merge_internal_keep", cmd);
+ assert_cmd_snapshot!(cmd, @"success: true\nexit_code: 0\n----- stdout -----\n\nMerge complete\n\nMerged: feature β†’ main\nWorktree: Kept (use 'wt remove' to clean up)\0\n\n----- stderr -----\n\0");
});
}
@@ -193,6 +229,6 @@ fn test_merge_internal_remove() {
.arg("main")
.current_dir(&feature_wt);
- assert_cmd_snapshot!("merge_internal_remove", cmd);
+ assert_cmd_snapshot!(cmd, @"success: true\nexit_code: 0\n----- stdout -----\n__WORKTRUNK_CD__[PATH]\0Removed worktree, returned to primary at [REPO]\0\n\nMerge complete\n\nMerged: feature β†’ main\nWorktree: Removed\0\n\n----- stderr -----\n\0\0\0");
});
}
diff --git a/tests/integration_tests/init.rs b/tests/integration_tests/init.rs
index 25dfaca2c..b7b2e08c3 100644
--- a/tests/integration_tests/init.rs
+++ b/tests/integration_tests/init.rs
@@ -58,7 +58,14 @@ fn test_init_invalid_shell() {
.arg("invalid-shell")
.current_dir(repo.root_path());
- assert_cmd_snapshot!("init_invalid_shell", cmd);
+ assert_cmd_snapshot!(cmd, @r"
+ success: false
+ exit_code: 1
+ ----- stdout -----
+
+ ----- stderr -----
+ Unsupported shell: invalid-shell
+ ");
});
}
diff --git a/tests/snapshots/integration__integration_tests__config_list__config_list_no_project.snap b/tests/snapshots/integration__integration_tests__config_list__config_list_no_project.snap
deleted file mode 100644
index 7e558331b..000000000
--- a/tests/snapshots/integration__integration_tests__config_list__config_list_no_project.snap
+++ /dev/null
@@ -1,30 +0,0 @@
----
-source: tests/integration_tests/config_list.rs
-info:
- program: wt
- args:
- - config
- - list
- env:
- CLICOLOR_FORCE: "1"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpg8SPRY
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp5FApx5/test-config.toml
----
-success: true
-exit_code: 0
------ stdout -----
-Global Config: [TEMP_HOME]/.config/worktrunk/config.toml
-  worktree-path = "../{main-worktree}.{branch}"
-
-Project Config: [REPO]/.config/wt.toml
-πŸ’‘ Not found
-
------ stderr -----
diff --git a/tests/snapshots/integration__integration_tests__config_list__config_list_outside_repo.snap b/tests/snapshots/integration__integration_tests__config_list__config_list_outside_repo.snap
deleted file mode 100644
index 9ce9912a4..000000000
--- a/tests/snapshots/integration__integration_tests__config_list__config_list_outside_repo.snap
+++ /dev/null
@@ -1,20 +0,0 @@
----
-source: tests/integration_tests/config_list.rs
-assertion_line: 128
-info:
- program: wt
- args:
- - config
- - list
- env:
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpEhOevy
----
-success: true
-exit_code: 0
------ stdout -----
-Global Config: [TEMP_HOME]/.config/worktrunk/config.toml
- worktree-path = "../{main-worktree}.{branch}"
-
-Project Config: Not in a git repository
-
------ stderr -----
diff --git a/tests/snapshots/integration__integration_tests__config_list__config_list_with_project.snap b/tests/snapshots/integration__integration_tests__config_list__config_list_with_project.snap
deleted file mode 100644
index e7350d1f6..000000000
--- a/tests/snapshots/integration__integration_tests__config_list__config_list_with_project.snap
+++ /dev/null
@@ -1,37 +0,0 @@
----
-source: tests/integration_tests/config_list.rs
-assertion_line: 58
-info:
- program: wt
- args:
- - config
- - list
- env:
- CLICOLOR_FORCE: "1"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmphN0eLh
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1704067200"
----
-success: true
-exit_code: 0
------ stdout -----
-Global Config: [TEMP_HOME]/.config/worktrunk/config.toml
-  worktree-path = "../{main-worktree}.{branch}"
- 
-  [[approved-commands]]
-  project = "test-project"
-  command = "npm install"
-
-Project Config: [REPO]/.config/wt.toml
-  post-create-command = "npm install"
- 
-  [post-start-command]
-  server = "npm run dev"
-
------ stderr -----
diff --git a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_already_exists.snap b/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_already_exists.snap
deleted file mode 100644
index d312b72c0..000000000
--- a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_already_exists.snap
+++ /dev/null
@@ -1,27 +0,0 @@
----
-source: tests/integration_tests/configure_shell.rs
-info:
- program: wt
- args:
- - configure-shell
- - "--shell"
- - zsh
- - "--yes"
- env:
- CLICOLOR_FORCE: "1"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpeWdD3U
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1704067200"
----
-success: true
-exit_code: 0
------ stdout -----
-βœ… All shells already configured
-
------ stderr -----
diff --git a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_custom_prefix.snap b/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_custom_prefix.snap
deleted file mode 100644
index 82ad70c1a..000000000
--- a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_custom_prefix.snap
+++ /dev/null
@@ -1,34 +0,0 @@
----
-source: tests/integration_tests/configure_shell.rs
-info:
- program: wt
- args:
- - configure-shell
- - "--shell"
- - bash
- - "--cmd"
- - worktree
- - "--yes"
- env:
- CLICOLOR_FORCE: "1"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpxFTOKL
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1704067200"
----
-success: true
-exit_code: 0
------ stdout -----
-Added bash [TEMP_HOME]/.bash_profile
-  if command -v worktree >/dev/null 2>&1; then eval "$(worktree init bash)"; fi
-
-βœ… Configured 1 shell
-
-πŸ’‘ Restart your shell or run: source <config-file>
-
------ stderr -----
diff --git a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_fish.snap b/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_fish.snap
deleted file mode 100644
index 9436a4eec..000000000
--- a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_fish.snap
+++ /dev/null
@@ -1,32 +0,0 @@
----
-source: tests/integration_tests/configure_shell.rs
-info:
- program: wt
- args:
- - configure-shell
- - "--shell"
- - fish
- - "--yes"
- env:
- CLICOLOR_FORCE: "1"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp0Zu3xW
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1704067200"
----
-success: true
-exit_code: 0
------ stdout -----
-Created fish [TEMP_HOME]/.config/fish/conf.d/wt.fish
-  if type -q wt; wt init fish | source; end
-
-βœ… Configured 1 shell
-
-πŸ’‘ Restart your shell or run: source <config-file>
-
------ stderr -----
diff --git a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_fish_custom_prefix.snap b/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_fish_custom_prefix.snap
deleted file mode 100644
index b12e99037..000000000
--- a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_fish_custom_prefix.snap
+++ /dev/null
@@ -1,34 +0,0 @@
----
-source: tests/integration_tests/configure_shell.rs
-info:
- program: wt
- args:
- - configure-shell
- - "--shell"
- - fish
- - "--cmd"
- - worktree
- - "--yes"
- env:
- CLICOLOR_FORCE: "1"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpOKerBG
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1704067200"
----
-success: true
-exit_code: 0
------ stdout -----
-Created fish [TEMP_HOME]/.config/fish/conf.d/worktree.fish
-  if type -q worktree; worktree init fish | source; end
-
-βœ… Configured 1 shell
-
-πŸ’‘ Restart your shell or run: source <config-file>
-
------ stderr -----
diff --git a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_mixed_states.snap b/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_mixed_states.snap
deleted file mode 100644
index 7e8577ff3..000000000
--- a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_mixed_states.snap
+++ /dev/null
@@ -1,32 +0,0 @@
----
-source: tests/integration_tests/configure_shell.rs
-info:
- program: wt
- args:
- - configure-shell
- - "--yes"
- env:
- CLICOLOR_FORCE: "1"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpB2w1cN
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1704067200"
----
-success: true
-exit_code: 0
------ stdout -----
-Already configured bash [TEMP_HOME]/.bash_profile
-  if command -v wt >/dev/null 2>&1; then eval "$(wt init bash)"; fi
-Added zsh [TEMP_HOME]/.zshrc
-  if command -v wt >/dev/null 2>&1; then eval "$(wt init zsh)"; fi
-
-βœ… Configured 1 shell
-
-πŸ’‘ Restart your shell or run: source <config-file>
-
------ stderr -----
diff --git a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_multiple_configs.snap b/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_multiple_configs.snap
deleted file mode 100644
index 67a6c8a60..000000000
--- a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_multiple_configs.snap
+++ /dev/null
@@ -1,32 +0,0 @@
----
-source: tests/integration_tests/configure_shell.rs
-info:
- program: wt
- args:
- - configure-shell
- - "--yes"
- env:
- CLICOLOR_FORCE: "1"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpKuNOGN
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1704067200"
----
-success: true
-exit_code: 0
------ stdout -----
-Added bash [TEMP_HOME]/.bash_profile
-  if command -v wt >/dev/null 2>&1; then eval "$(wt init bash)"; fi
-Added zsh [TEMP_HOME]/.zshrc
-  if command -v wt >/dev/null 2>&1; then eval "$(wt init zsh)"; fi
-
-βœ… Configured 2 shells
-
-πŸ’‘ Restart your shell or run: source <config-file>
-
------ stderr -----
diff --git a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_no_files.snap b/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_no_files.snap
deleted file mode 100644
index ed5335a3b..000000000
--- a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_no_files.snap
+++ /dev/null
@@ -1,24 +0,0 @@
----
-source: tests/integration_tests/configure_shell.rs
-info:
- program: wt
- args:
- - configure-shell
- env:
- CLICOLOR_FORCE: "1"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpQPnent
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1704067200"
----
-success: false
-exit_code: 1
------ stdout -----
-
------ stderr -----
-No shell config files found in $HOME. Checked: [TEMP_HOME]/.bash_profile, [TEMP_HOME]/.profile, [TEMP_HOME]/.zshrc, and more. Create a config file or use --shell to specify a shell.
diff --git a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_with_yes.snap b/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_with_yes.snap
deleted file mode 100644
index 6bed2369a..000000000
--- a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_with_yes.snap
+++ /dev/null
@@ -1,30 +0,0 @@
----
-source: tests/integration_tests/configure_shell.rs
-info:
- program: wt
- args:
- - configure-shell
- - "--yes"
- env:
- CLICOLOR_FORCE: "1"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp8JiWs5
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1704067200"
----
-success: true
-exit_code: 0
------ stdout -----
-Added zsh [TEMP_HOME]/.zshrc
-  if command -v wt >/dev/null 2>&1; then eval "$(wt init zsh)"; fi
-
-βœ… Configured 1 shell
-
-πŸ’‘ Restart your shell or run: source <config-file>
-
------ stderr -----
diff --git a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_zsh.snap b/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_zsh.snap
deleted file mode 100644
index 03e2a8c30..000000000
--- a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_zsh.snap
+++ /dev/null
@@ -1,32 +0,0 @@
----
-source: tests/integration_tests/configure_shell.rs
-info:
- program: wt
- args:
- - configure-shell
- - "--shell"
- - zsh
- - "--yes"
- env:
- CLICOLOR_FORCE: "1"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp8d5PlC
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1704067200"
----
-success: true
-exit_code: 0
------ stdout -----
-Added zsh [TEMP_HOME]/.zshrc
-  if command -v wt >/dev/null 2>&1; then eval "$(wt init zsh)"; fi
-
-βœ… Configured 1 shell
-
-πŸ’‘ Restart your shell or run: source <config-file>
-
------ stderr -----
diff --git a/tests/snapshots/integration__integration_tests__directives__merge_internal_keep.snap b/tests/snapshots/integration__integration_tests__directives__merge_internal_keep.snap
deleted file mode 100644
index 054b121db..000000000
Binary files a/tests/snapshots/integration__integration_tests__directives__merge_internal_keep.snap and /dev/null differ
diff --git a/tests/snapshots/integration__integration_tests__directives__merge_internal_remove.snap b/tests/snapshots/integration__integration_tests__directives__merge_internal_remove.snap
deleted file mode 100644
index cfaf2b91f..000000000
Binary files a/tests/snapshots/integration__integration_tests__directives__merge_internal_remove.snap and /dev/null differ
diff --git a/tests/snapshots/integration__integration_tests__directives__remove_internal_directive.snap b/tests/snapshots/integration__integration_tests__directives__remove_internal_directive.snap
deleted file mode 100644
index eb61af9fd..000000000
--- a/tests/snapshots/integration__integration_tests__directives__remove_internal_directive.snap
+++ /dev/null
@@ -1,28 +0,0 @@
----
-source: tests/integration_tests/directives.rs
-info:
- program: wt
- args:
- - remove
- - "--internal"
- env:
- CLICOLOR_FORCE: "1"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1704067200"
----
-success: false
-exit_code: 1
------ stdout -----
-
------ stderr -----
-fatal: 'origin' does not appear to be a git repository
-fatal: Could not read from remote repository.
-
-Please make sure you have the correct access rights
-and the repository exists.
diff --git a/tests/snapshots/integration__integration_tests__directives__remove_without_internal.snap b/tests/snapshots/integration__integration_tests__directives__remove_without_internal.snap
deleted file mode 100644
index 143917a7d..000000000
--- a/tests/snapshots/integration__integration_tests__directives__remove_without_internal.snap
+++ /dev/null
@@ -1,27 +0,0 @@
----
-source: tests/integration_tests/directives.rs
-info:
- program: wt
- args:
- - remove
- env:
- CLICOLOR_FORCE: "1"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1704067200"
----
-success: false
-exit_code: 1
------ stdout -----
-
------ stderr -----
-fatal: 'origin' does not appear to be a git repository
-fatal: Could not read from remote repository.
-
-Please make sure you have the correct access rights
-and the repository exists.
diff --git a/tests/snapshots/integration__integration_tests__directives__switch_internal_directive.snap b/tests/snapshots/integration__integration_tests__directives__switch_internal_directive.snap
deleted file mode 100644
index 8b3203583..000000000
--- a/tests/snapshots/integration__integration_tests__directives__switch_internal_directive.snap
+++ /dev/null
@@ -1,25 +0,0 @@
----
-source: tests/integration_tests/directives.rs
-info:
- program: wt
- args:
- - switch
- - my-feature
- - "--internal"
- env:
- CLICOLOR_FORCE: "1"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1704067200"
----
-success: false
-exit_code: 1
------ stdout -----
-
------ stderr -----
-Failed to create worktree: fatal: invalid reference: my-feature
diff --git a/tests/snapshots/integration__integration_tests__directives__switch_without_internal.snap b/tests/snapshots/integration__integration_tests__directives__switch_without_internal.snap
deleted file mode 100644
index b65d644e4..000000000
--- a/tests/snapshots/integration__integration_tests__directives__switch_without_internal.snap
+++ /dev/null
@@ -1,24 +0,0 @@
----
-source: tests/integration_tests/directives.rs
-info:
- program: wt
- args:
- - switch
- - my-feature
- env:
- CLICOLOR_FORCE: "1"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1704067200"
----
-success: false
-exit_code: 1
------ stdout -----
-
------ stderr -----
-Failed to create worktree: fatal: invalid reference: my-feature
diff --git a/tests/snapshots/integration__integration_tests__init__init_invalid_shell.snap b/tests/snapshots/integration__integration_tests__init__init_invalid_shell.snap
deleted file mode 100644
index 5d0dade61..000000000
--- a/tests/snapshots/integration__integration_tests__init__init_invalid_shell.snap
+++ /dev/null
@@ -1,24 +0,0 @@
----
-source: tests/integration_tests/init.rs
-info:
- program: wt
- args:
- - init
- - invalid-shell
- env:
- CLICOLOR_FORCE: "1"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1704067200"
----
-success: false
-exit_code: 1
------ stdout -----
-
------ stderr -----
-Unsupported shell: invalid-shell