1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use crate::jcli::command::votes::CrsCommand;
use assert_cmd::assert::OutputAssertExt;
use jortestkit::prelude::ProcessOutput;

pub struct Crs {
    crs_command: CrsCommand,
}

impl Crs {
    pub fn new(crs_command: CrsCommand) -> Self {
        Self { crs_command }
    }

    pub fn generate(self) -> String {
        self.crs_command
            .generate()
            .build()
            .assert()
            .success()
            .get_output()
            .as_single_line()
    }
}