mit_commit_message_lints/
scope.rs1#[derive(Ord, PartialOrd, Eq, PartialEq, Debug, Clone, clap::ValueEnum, Copy)]
5pub enum Scope {
6 Global,
8 Local,
10}
11impl Scope {
12 #[must_use]
14 pub fn is_global(&self) -> bool {
15 &Self::Global == self
16 }
17}
18
19#[cfg(test)]
20mod tests {
21 use super::Scope;
22
23 #[test]
24 fn global_scope_is_global() {
25 assert!(
26 Scope::Global.is_global(),
27 "Expected the Global scope to report as global"
28 );
29 }
30
31 #[test]
32 fn local_scope_is_not_global() {
33 assert!(
34 !Scope::Local.is_global(),
35 "Expected the Local scope to not report as global"
36 );
37 }
38}