Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey committed Feb 12, 2024
1 parent 592a012 commit 893f9e4
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions tests/acceptance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
)]

use abscissa_core::testing::prelude::*;
use zcash_tx_tool::config::AppConfig;
use once_cell::sync::Lazy;

/// Executes your application binary via `cargo run`.
Expand All @@ -30,58 +29,6 @@ use once_cell::sync::Lazy;
/// invocations as `cargo test` executes tests in parallel by default.
pub static RUNNER: Lazy<CmdRunner> = Lazy::new(|| CmdRunner::default());

/// Use `AppConfig::default()` value if no config or args
#[test]
fn start_no_args() {
let mut runner = RUNNER.clone();
let mut cmd = runner.arg("start").capture_stdout().run();
cmd.stdout().expect_line("Hello, world!");
cmd.wait().unwrap().expect_success();
}

/// Use command-line argument value
#[test]
fn start_with_args() {
let mut runner = RUNNER.clone();
let mut cmd = runner
.args(&["start", "acceptance", "test"])
.capture_stdout()
.run();

cmd.stdout().expect_line("Hello, acceptance test!");
cmd.wait().unwrap().expect_success();
}

/// Use configured value
#[test]
fn start_with_config_no_args() {
let mut config = AppConfig::default();
config.wallet.seed_phrase = "configured recipient".to_owned();
let expected_line = format!("Hello, {}!", &config.wallet.seed_phrase);

let mut runner = RUNNER.clone();
let mut cmd = runner.config(&config).arg("start").capture_stdout().run();
cmd.stdout().expect_line(&expected_line);
cmd.wait().unwrap().expect_success();
}

/// Override configured value with command-line argument
#[test]
fn start_with_config_and_args() {
let mut config = AppConfig::default();
config.wallet.seed_phrase = "configured recipient".to_owned();

let mut runner = RUNNER.clone();
let mut cmd = runner
.config(&config)
.args(&["start", "acceptance", "test"])
.capture_stdout()
.run();

cmd.stdout().expect_line("Hello, acceptance test!");
cmd.wait().unwrap().expect_success();
}

/// Example of a test which matches a regular expression
#[test]
fn version_no_args() {
Expand Down

0 comments on commit 893f9e4

Please sign in to comment.