Skip to content

Commit 1c4c61c

Browse files
committed
Remove duplicated tests
1 parent 8dc9f8a commit 1c4c61c

21 files changed

+0
-776
lines changed

tests/test_bisect.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -599,21 +599,6 @@ fn test_bisect_start_relative_commits() {
599599
.success();
600600
}
601601

602-
#[test]
603-
fn test_bisect_command_traits() {
604-
use git_x::commands::commit::{BisectAction, BisectCommand};
605-
use git_x::core::traits::Command;
606-
607-
let cmd = BisectCommand::new(BisectAction::Status);
608-
609-
// Test Command trait implementation
610-
assert_eq!(cmd.name(), "bisect");
611-
assert_eq!(
612-
cmd.description(),
613-
"Simplified Git bisect workflow for finding bugs"
614-
);
615-
}
616-
617602
#[test]
618603
fn test_bisect_command_direct() {
619604
use git_x::commands::commit::{BisectAction, BisectCommand};

tests/test_clean_branches.rs

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -70,58 +70,6 @@ fn test_clean_branches_run_function_actual_delete() {
7070
let _ = std::env::set_current_dir(&original_dir);
7171
}
7272

73-
#[test]
74-
fn test_clean_branches_run_function_with_branches_to_delete() {
75-
let repo = repo_with_merged_branch("test-branch", "master");
76-
let original_dir = std::env::current_dir().unwrap();
77-
78-
// Switch back to master to ensure the test branch is merged
79-
repo.checkout_branch("master");
80-
81-
// Change to repo directory and run the function directly
82-
std::env::set_current_dir(repo.path()).unwrap();
83-
84-
let cmd = CleanBranchesCommand::new(true);
85-
let result = cmd.execute();
86-
assert!(result.is_ok());
87-
88-
// Restore original directory
89-
let _ = std::env::set_current_dir(&original_dir);
90-
}
91-
92-
#[test]
93-
fn test_clean_branches_run_function_non_dry_run_with_branches() {
94-
if !should_run_destructive_tests() {
95-
return;
96-
}
97-
98-
let repo = repo_with_merged_branch("test-non-dry", "master");
99-
let original_dir = std::env::current_dir().unwrap();
100-
101-
// Switch back to master to ensure the test branch is merged
102-
repo.checkout_branch("master");
103-
104-
// Change to repo directory and run the function directly
105-
std::env::set_current_dir(repo.path()).unwrap();
106-
107-
// Set non-interactive mode for this test
108-
unsafe {
109-
std::env::set_var("GIT_X_NON_INTERACTIVE", "1");
110-
}
111-
112-
let cmd = CleanBranchesCommand::new(false);
113-
let result = cmd.execute();
114-
assert!(result.is_ok());
115-
116-
// Clean up environment variable
117-
unsafe {
118-
std::env::remove_var("GIT_X_NON_INTERACTIVE");
119-
}
120-
121-
// Restore original directory
122-
let _ = std::env::set_current_dir(&original_dir);
123-
}
124-
12573
#[test]
12674
fn test_clean_branches_run_function_no_branches() {
12775
let repo = common::basic_repo();
@@ -169,12 +117,3 @@ fn test_clean_branches_actually_deletes_branch() {
169117
let stdout_after = String::from_utf8_lossy(&output_after.stdout);
170118
assert!(!stdout_after.contains("feature/cleanup"));
171119
}
172-
173-
#[test]
174-
fn test_clean_branches_command_traits() {
175-
let cmd = CleanBranchesCommand::new(true);
176-
177-
// Test Command trait implementation
178-
assert_eq!(cmd.name(), "clean-branches");
179-
assert_eq!(cmd.description(), "Delete merged branches");
180-
}

tests/test_color_graph.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,3 @@ fn test_color_graph_run_function_in_non_git_directory() {
3737
// Restore original directory
3838
let _ = std::env::set_current_dir(&original_dir);
3939
}
40-
41-
#[test]
42-
fn test_color_graph_command_traits() {
43-
let cmd = ColorGraphCommand::new();
44-
45-
// Test Command trait implementation
46-
assert_eq!(cmd.name(), "color-graph");
47-
assert_eq!(cmd.description(), "Show a colored commit graph");
48-
}

tests/test_contributors.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -412,15 +412,3 @@ fn test_contributors_command_direct() {
412412
// Restore original directory
413413
let _ = std::env::set_current_dir(&original_dir);
414414
}
415-
416-
#[test]
417-
fn test_contributors_command_traits() {
418-
let cmd = ContributorsCommand::new(None);
419-
420-
// Test Command trait implementation
421-
assert_eq!(cmd.name(), "contributors");
422-
assert_eq!(
423-
cmd.description(),
424-
"Show repository contributors and their commit statistics"
425-
);
426-
}

tests/test_fixup.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,6 @@ fn test_fixup_run_function_outside_git_repo() {
1818
.stderr(predicate::str::contains("Commit hash does not exist"));
1919
}
2020

21-
#[test]
22-
fn test_fixup_command_traits() {
23-
use git_x::commands::commit::FixupCommand;
24-
use git_x::core::traits::Command;
25-
26-
let cmd = FixupCommand::new("abc123".to_string(), false);
27-
28-
// Test Command trait implementation
29-
assert_eq!(cmd.name(), "fixup");
30-
assert_eq!(
31-
cmd.description(),
32-
"Create fixup commits for easier interactive rebasing"
33-
);
34-
}
35-
3621
#[test]
3722
fn test_fixup_command_direct() {
3823
use git_x::commands::commit::FixupCommand;
@@ -128,14 +113,3 @@ fn test_fixup_command_help() {
128113
"Create fixup commits for easier interactive rebasing",
129114
));
130115
}
131-
132-
#[test]
133-
fn test_fixup_rebase_flag() {
134-
let mut cmd = Command::cargo_bin("git-x").expect("Failed to find binary");
135-
cmd.args(["fixup", "abc123", "--rebase", "--help"])
136-
.assert()
137-
.success()
138-
.stdout(predicate::str::contains(
139-
"Automatically rebase with autosquash after creating fixup",
140-
));
141-
}

tests/test_graph.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,3 @@ fn test_graph_run_function_in_non_git_directory() {
7474
// Restore original directory
7575
let _ = std::env::set_current_dir(&original_dir);
7676
}
77-
78-
#[test]
79-
fn test_graph_command_traits() {
80-
use git_x::commands::analysis::GraphCommand;
81-
use git_x::core::traits::Command;
82-
83-
let cmd = GraphCommand::new();
84-
85-
// Test Command trait implementation
86-
assert_eq!(cmd.name(), "graph");
87-
assert_eq!(cmd.description(), "Show a simple commit graph");
88-
}

tests/test_health.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -230,18 +230,6 @@ fn test_health_command_direct() {
230230
let _ = std::env::set_current_dir(&original_dir);
231231
}
232232

233-
#[test]
234-
fn test_health_command_traits() {
235-
let cmd = HealthCommand::new();
236-
237-
// Test Command trait implementation
238-
assert_eq!(cmd.name(), "health");
239-
assert_eq!(
240-
cmd.description(),
241-
"Check repository health and configuration"
242-
);
243-
}
244-
245233
#[test]
246234
fn test_health_command_in_non_git_directory() {
247235
let temp_dir = tempfile::tempdir().unwrap();

tests/test_info.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,6 @@ fn test_info_command_direct() {
140140
assert!(output.contains("Current branch:"));
141141
}
142142

143-
#[test]
144-
fn test_info_command_traits() {
145-
let cmd = InfoCommand::new();
146-
147-
// Test Command trait implementation
148-
assert_eq!(cmd.name(), "info");
149-
assert_eq!(cmd.description(), "Show repository information and status");
150-
}
151-
152143
#[test]
153144
fn test_info_command_with_details() {
154145
let (repo, _remote) = repo_with_remote_ahead("main");

0 commit comments

Comments
 (0)