Skip to content

Commit e3a6765

Browse files
committed
test: fix CLI tests to match first-class parameter behavior
Update three tests that were checking for --data requirement to now check for --name or required parameters. With first-class parameters in v0.6.6, these commands accept CLI flags and --name is required instead of --data.
1 parent 0e9a6e5 commit e3a6765

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

crates/redisctl/tests/cli_basic_tests.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,7 @@ fn test_cloud_database_create_missing_subscription() {
11541154

11551155
#[test]
11561156
fn test_cloud_database_create_missing_data() {
1157+
// With first-class parameters, --name is required (not --data)
11571158
redisctl()
11581159
.arg("cloud")
11591160
.arg("database")
@@ -1162,7 +1163,7 @@ fn test_cloud_database_create_missing_data() {
11621163
.arg("123")
11631164
.assert()
11641165
.failure()
1165-
.stderr(predicate::str::contains("required"));
1166+
.stderr(predicate::str::contains("--name").or(predicate::str::contains("required")));
11661167
}
11671168

11681169
#[test]
@@ -1191,13 +1192,14 @@ fn test_cloud_database_delete_missing_args() {
11911192

11921193
#[test]
11931194
fn test_cloud_subscription_create_missing_data() {
1195+
// With first-class parameters, --name is required (not --data)
11941196
redisctl()
11951197
.arg("cloud")
11961198
.arg("subscription")
11971199
.arg("create")
11981200
.assert()
11991201
.failure()
1200-
.stderr(predicate::str::contains("required"));
1202+
.stderr(predicate::str::contains("--name").or(predicate::str::contains("required")));
12011203
}
12021204

12031205
#[test]
@@ -1226,13 +1228,14 @@ fn test_cloud_subscription_delete_missing_id() {
12261228

12271229
#[test]
12281230
fn test_enterprise_database_create_missing_data() {
1231+
// With first-class parameters, --name is required (not --data)
12291232
redisctl()
12301233
.arg("enterprise")
12311234
.arg("database")
12321235
.arg("create")
12331236
.assert()
12341237
.failure()
1235-
.stderr(predicate::str::contains("required"));
1238+
.stderr(predicate::str::contains("--name").or(predicate::str::contains("required")));
12361239
}
12371240

12381241
#[test]

0 commit comments

Comments
 (0)