1pub struct Library {
2 pub name: String,
3 pub group: String,
4 pub version: String,
5 pub scope: LibraryScope,
6}
7
8#[derive(PartialEq, Debug)]
9pub enum LibraryScope {
10 Test,
11 Compile,
12}
13
14#[cfg(test)]
15mod tests {
16 use crate::{Library, LibraryScope};
17
18 #[test]
19 fn should_create_library() {
20 let lib = Library {
21 group: "org.springframework.boot".to_string(),
22 name: "spring-boot-starter-web".to_string(),
23 version: "1.0.0-RELEASE".to_string(),
24 scope: LibraryScope::Compile,
25 };
26
27 assert_eq!(lib.group, "org.springframework.boot".to_string());
28 assert_eq!(lib.name, "spring-boot-starter-web".to_string());
29 assert_eq!(lib.version, "1.0.0-RELEASE".to_string());
30 assert_eq!(lib.scope, LibraryScope::Compile);
31 }
32}