mirror of
https://github.com/imjasonh/testscript-rs
synced 2026-07-08 09:05:34 +00:00
Address PR feedback: remove printlns and make [net] condition available by default
Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
This commit is contained in:
parent
d01b8865de
commit
22499cb0ee
4 changed files with 42 additions and 8 deletions
|
|
@ -3,17 +3,13 @@
|
|||
use testscript_rs::testscript;
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
println!("Running testscript with advanced condition support...");
|
||||
|
||||
// Example 1: Basic usage with auto-detection
|
||||
println!("\n=== Example 1: Auto-detect network and programs ===");
|
||||
testscript::run("testdata")
|
||||
.auto_detect_network()
|
||||
.auto_detect_programs(&["docker", "git", "npm", "echo"])
|
||||
.execute()?;
|
||||
|
||||
// Example 2: Manual condition setting with environment variables
|
||||
println!("\n=== Example 2: Environment-based conditions ===");
|
||||
|
||||
// Set a test environment variable
|
||||
std::env::set_var("CI", "true");
|
||||
|
|
@ -23,7 +19,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
.condition("docker", command_exists("docker"))
|
||||
.execute()?;
|
||||
|
||||
println!("All tests completed successfully!");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue