diff --git a/tests/maven/pom_parser_test.rs b/tests/maven/pom_parser_test.rs index c3641a1..c18652b 100644 --- a/tests/maven/pom_parser_test.rs +++ b/tests/maven/pom_parser_test.rs @@ -11,23 +11,29 @@ fn test_pom_parser_is_correct() { assert_eq!(Some("jar".to_string()),pom.packaging); assert_eq!(Some("http://www.mockito.org".to_string()),pom.url); - assert_eq!(2, pom.properties.len()); + assert_eq!(3, pom.properties.len()); assert_eq!("17", pom.properties["maven.compiler.source"]); assert_eq!("21", pom.properties["maven.compiler.target"]); + assert_eq!("1.1", pom.properties["hamcrest.version"]); assert_eq!(2, pom.dependencies.len()); let hamcrest = &pom.dependencies[0]; assert_eq!("org.hamcrest", hamcrest.group_id); assert_eq!("hamcrest-core", hamcrest.artifact_id); - assert_eq!(Some("1.1".to_string()), hamcrest.version); + assert_eq!(None, hamcrest.version); let objenesis = &pom.dependencies[1]; assert_eq!("org.objenesis", objenesis.group_id); assert_eq!("objenesis", objenesis.artifact_id); assert_eq!(Some("1.0".to_string()), objenesis.version); - assert!(pom.dependency_management.is_empty()); assert_eq!(2, pom.modules.len()); assert_eq!("a", pom.modules[0]); assert_eq!("b", pom.modules[1]); + + assert_eq!(1, pom.dependency_management.len()); + let hamcrest = &pom.dependency_management[0]; + assert_eq!("org.hamcrest", hamcrest.group_id); + assert_eq!("hamcrest-core", hamcrest.artifact_id); + assert_eq!(Some("${hamcrest.version}".to_string()), hamcrest.version); } diff --git a/tests/maven/resources/pom.xml b/tests/maven/resources/pom.xml index a416f78..66a504a 100644 --- a/tests/maven/resources/pom.xml +++ b/tests/maven/resources/pom.xml @@ -11,6 +11,7 @@ 17 21 + 1.1 http://www.mockito.org @@ -22,17 +23,26 @@ repo - + a b + + + + org.hamcrest + hamcrest-core + ${hamcrest.version} + + + + org.hamcrest hamcrest-core - 1.1 org.objenesis