dagger-rs/crates/dagger-sdk/tests/mod.rs
kjuulh 94336d0637 feat(sdk): move to &str instead of String and introduce builder.
This will make the api much easier to use, as we can now rely on ""
instead of "".into() for normal string values.

Introduced builder as well, which makes it much easier to use *Opts, as
it can handle the building of that, and get the benefits from String ->
&str, as that is currently not allowed for optional values
2023-02-19 18:00:04 +01:00

21 lines
488 B
Rust

use dagger_sdk::{connect, ContainerExecOptsBuilder};
#[test]
fn test_example_container() {
let client = connect().unwrap();
let alpine = client.container(None).from("alpine:3.16.2");
let out = alpine
.exec(Some(
ContainerExecOptsBuilder::default()
.args(vec!["cat", "/etc/alpine-release"])
.build()
.unwrap(),
))
.stdout()
.unwrap();
assert_eq!(out, "3.16.2\n".to_string())
}