Skip to content

Commit e2c5828

Browse files
committed
refactor: [#227] rename tests in presentation test controllers
Renamed 6 test functions and 1 helper function in test controllers and reentrancy tests. Tests: All tests pass
1 parent cae8402 commit e2c5828

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/presentation/controllers/test/errors.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ mod tests {
269269
use super::*;
270270

271271
#[test]
272-
fn test_invalid_environment_name_help_message() {
272+
fn it_should_display_help_message_when_environment_name_is_invalid() {
273273
let error = TestSubcommandError::InvalidEnvironmentName {
274274
name: "invalid_name".to_string(),
275275
source: EnvironmentNameError::InvalidFormat {
@@ -286,7 +286,7 @@ mod tests {
286286
}
287287

288288
#[test]
289-
fn test_environment_not_found_help_message() {
289+
fn it_should_display_help_message_when_environment_not_found() {
290290
let error = TestSubcommandError::EnvironmentNotFound {
291291
name: "test-env".to_string(),
292292
data_dir: "/path/to/data".to_string(),
@@ -299,7 +299,7 @@ mod tests {
299299
}
300300

301301
#[test]
302-
fn test_missing_instance_ip_help_message() {
302+
fn it_should_display_help_message_when_instance_ip_is_missing() {
303303
let error = TestSubcommandError::MissingInstanceIp {
304304
name: "test-env".to_string(),
305305
};
@@ -310,7 +310,7 @@ mod tests {
310310
}
311311

312312
#[test]
313-
fn test_validation_failed_help_message() {
313+
fn it_should_display_help_message_when_validation_fails() {
314314
let error = TestSubcommandError::ValidationFailed {
315315
name: "test-env".to_string(),
316316
source: Box::new(TestCommandHandlerError::MissingInstanceIp {

src/presentation/controllers/test/handler.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl TestCommandController {
117117
let handler = self.create_command_handler()?;
118118

119119
// 3. Execute validation workflow via application layer
120-
self.test_infrastructure(&handler, &env_name).await?;
120+
self.fixture_infrastructure(&handler, &env_name).await?;
121121

122122
// 4. Complete workflow
123123
self.complete_workflow(environment_name)?;
@@ -176,7 +176,7 @@ impl TestCommandController {
176176
/// # Errors
177177
///
178178
/// Returns `TestSubcommandError::ValidationFailed` if any validation check fails
179-
async fn test_infrastructure(
179+
async fn fixture_infrastructure(
180180
&mut self,
181181
handler: &TestCommandHandler,
182182
env_name: &EnvironmentName,

src/presentation/tests/reentrancy_fix_test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::presentation::views::{UserOutput, VerbosityLevel};
1414
/// 3. With `std::sync::Mutex`, this would deadlock because same thread tries to acquire twice
1515
/// 4. With `ReentrantMutex`, this should work fine
1616
#[test]
17-
fn test_reentrancy_deadlock_fix_issue_164() {
17+
fn it_should_not_deadlock_when_nested_user_output_calls_occur() {
1818
// Create a UserOutput wrapped in ReentrantMutex<RefCell<>> pattern
1919
let user_output = Arc::new(ReentrantMutex::new(RefCell::new(UserOutput::new(
2020
VerbosityLevel::Silent,
@@ -53,7 +53,7 @@ fn test_reentrancy_deadlock_fix_issue_164() {
5353

5454
/// More comprehensive test that simulates the exact deadlock scenario from production
5555
#[test]
56-
fn test_comprehensive_reentrancy_scenario() {
56+
fn it_should_handle_complex_nested_output_when_testing_reentrancy() {
5757
let user_output = Arc::new(ReentrantMutex::new(RefCell::new(UserOutput::new(
5858
VerbosityLevel::Silent,
5959
))));

0 commit comments

Comments
 (0)