krabby_cli/
shell.rs

1pub struct Shell(pub Flavor);
2
3pub enum Flavor {
4    Bash,
5    Zsh,
6}
7
8impl Shell {
9    pub fn script(&self) -> String {
10        match &self.0 {
11            Flavor::Bash | Flavor::Zsh => {
12                let script = include_str!("../scripts/kb.sh");
13                script.to_string()
14            }
15        }
16    }
17}
18
19#[cfg(test)]
20mod tests {
21    use super::*;
22
23    #[test]
24    fn script_is_not_empty() {
25        let cases = vec![Flavor::Bash, Flavor::Zsh];
26
27        for case in cases {
28            let shell = Shell(case);
29            assert!(!shell.script().is_empty());
30        }
31    }
32}