Skip to content

Commit

Permalink
Test the actual host impl
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Levick <[email protected]>
  • Loading branch information
rylev committed Jul 23, 2024
1 parent 23b5d12 commit 203b527
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions crates/factor-variables/tests/factor_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use spin_factor_variables::spin_cli::{EnvVariables, RuntimeConfig, StaticVariabl
use spin_factor_variables::VariablesFactor;
use spin_factors::{anyhow, RuntimeFactors};
use spin_factors_test::{toml, TestEnvironment};
use spin_world::v2::variables::Host;

#[derive(RuntimeFactors)]
struct TestFactors {
Expand Down Expand Up @@ -35,12 +36,8 @@ async fn static_provider_works() -> anyhow::Result<()> {
factors.variables.add_provider_resolver(EnvVariables)?;

let env = test_env();
let state = env.build_instance_state(factors).await?;
let val = state
.variables
.expression_resolver()
.resolve("test-component", "baz".try_into().unwrap())
.await?;
let mut state = env.build_instance_state(factors).await?;
let val = state.variables.get("baz".try_into().unwrap()).await?;
assert_eq!(val, "<bar>");
Ok(())
}

0 comments on commit 203b527

Please sign in to comment.