add tests for local-gossip-mode exclusivity
@@ -8,6 +8,7 @@ pub fn cli<'a, 'b>() -> App<'a, 'b> { sup_commands() }
mod test {
use super::cli;
use clap::ErrorKind;
+ use std::iter::FromIterator;
macro_rules! assert_cli_cmd {
($test:ident, $cmd:expr, $( $key:expr => $value:tt ),+) => {
@@ -55,6 +56,22 @@ mod test {
"BIND" => ["service.group1", "service.group2"],
"PKG_IDENT_OR_ARTIFACT" => "core/redis");
+ #[test]
+ fn local_gossip_mode_and_listen_gossip_are_mutually_exclusive() {
+ let cmd_vec = Vec::from_iter(
+ "hab-sup run --listen-gossip 1.1.1.1:1111 --local-gossip-mode".split_whitespace(),
+ );
+ assert!(cli().get_matches_from_safe(cmd_vec).is_err());
+ }
+
+ #[test]
+ fn local_gossip_mode_and_peer_are_mutually_exclusive() {
+ let cmd_vec = Vec::from_iter(
+ "hab-sup run --peer 1.1.1.1:1111 --local-gossip-mode".split_whitespace(),
+ );
+ assert!(cli().get_matches_from_safe(cmd_vec).is_err());
+ }
+
}
}
