Skip to content

Commit

Permalink
Update setup-scripts.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshowers authored Sep 27, 2023
1 parent dd4d298 commit 8f0746e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions site/src/book/setup-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ if [ -z "$NEXTEST_ENV" ]; then
fi

# Write out an environment variable to $NEXTEST_ENV.
echo "NEXTEST_ENV_VAR=Hello, world!" >> "$NEXTEST_ENV"
echo "MY_ENV_VAR=Hello, world!" >> "$NEXTEST_ENV"
```

And you define a setup script and a corresponding rule:
Expand All @@ -114,6 +114,6 @@ Then, in tests which match this script, the environment variable will be availab
```rust
#[test]
fn my_env_test() {
assert_eq!(std::env::var("NEXTEST_ENV_VAR"), Ok("Hello, world!".to_string()));
assert_eq!(std::env::var("MY_ENV_VAR"), Ok("Hello, world!".to_string()));
}
```

0 comments on commit 8f0746e

Please sign in to comment.