pub fn test_success(ctx) {
}

pub fn test_failure(ctx) {
    ctx.report_error("This test has failed.", here!());
}

fn start_hello_command(ctx) {
    ctx
        .run_command(
            format!("{}/stories-test", stories::cargo_build_dir()),
            ["--print-hello"],
            here!(),
        )
        .unwrap()
}

pub fn test_run_command(ctx) {
    start_hello_command(ctx);
}

pub fn test_fail_run_command(ctx) {
    ctx.run_command("executable-does-not-exist", [], here!());
}

pub fn test_run_command_check_output(ctx) {
    let cmd = start_hello_command(ctx);
    cmd.stdout().contains("hello", here!());
}

pub fn test_run_command_check_output_failure(ctx) {
    let cmd = start_hello_command(ctx);
    cmd.stdout().contains("world", here!());
}
