Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: show current table in list #180

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(())
}
Loading