Skip to content

Commit

Permalink
test: show current table in list
Browse files Browse the repository at this point in the history
  • Loading branch information
ryota-sakamoto authored and StoneDot committed Oct 17, 2023
1 parent b5127cc commit 9f58756
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,20 @@ async fn test_list_table_with_no_table() -> Result<(), Box<dyn std::error::Error

#[tokio::test]
async fn test_list_table_with_multiple_tables() -> Result<(), Box<dyn std::error::Error>> {
let mut tm = util::setup().await?;
let mut tm = util::setup_with_lock().await?;
let table_name = tm.create_temporary_table("pk", None).await?;
let table_name2 = tm.create_temporary_table("pk", None).await?;

let mut c = tm.command()?;
let cmd = c.args(&["--region", "local", "use", &table_name]);
cmd.assert().success();

let mut c = tm.command()?;
let cmd = c.args(&["--region", "local", "list"]);
cmd.assert()
.success()
.stdout(predicate::str::contains("DynamoDB tables in region: local"))
.stdout(predicate::str::contains(&table_name))
.stdout(predicate::str::contains(format!("* {table_name}")))
.stdout(predicate::str::contains(&table_name2));
Ok(())
}

0 comments on commit 9f58756

Please sign in to comment.