mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2024-11-12 20:21:52 +01:00
kjuulh
9762da895a
Now all opt values enter into a _opts function instead of the original. This avoids a lot of verbosity for both None in the case opts are unwanted, and Some() if they actually are. They are used like so: ```rust client.container().from("..."); client.container_opts(Some(ContainerOpts{ ... })) ``` Some from opts will be removed in a future commit/pr
21 lines
489 B
Rust
21 lines
489 B
Rust
use dagger_sdk::{connect, ContainerExecOptsBuilder};
|
|
|
|
#[test]
|
|
fn test_example_container() {
|
|
let client = connect().unwrap();
|
|
|
|
let alpine = client.container().from("alpine:3.16.2");
|
|
|
|
let out = alpine
|
|
.exec_opts(Some(
|
|
ContainerExecOptsBuilder::default()
|
|
.args(vec!["cat", "/etc/alpine-release"])
|
|
.build()
|
|
.unwrap(),
|
|
))
|
|
.stdout()
|
|
.unwrap();
|
|
|
|
assert_eq!(out, "3.16.2\n".to_string())
|
|
}
|