Skip to content

Commit

Permalink
basic test for the env feature
Browse files Browse the repository at this point in the history
to see how it goes on all the tests platforms. Executing an external
program may not be easy with some cross platforms or on windows
  • Loading branch information
glehmann committed Feb 10, 2024
1 parent c70a9e4 commit 0dd2c64
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/env.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
mod common;

use assert_fs::fixture::PathChild;
use common::*;
use predicates::str::{contains, is_empty};

const YAML_CONTENT: &str = "foo: bar";

#[test]
fn env() {
let tmp = temp_dir();
let (key_path, pub_path) = create_key(&tmp);
let yaml_path = tmp.child("file.yaml");
write(&yaml_path, YAML_CONTENT);
let encrypted_path = tmp.child("file.enc.yaml");
yage!(
"encrypt",
"-R",
&pub_path,
&yaml_path,
"-o",
&encrypted_path
);
yage!("env", "-K", &key_path, &encrypted_path, "env")
.stdout(contains("foo=bar"))
.stderr(is_empty());
}

0 comments on commit 0dd2c64

Please sign in to comment.