summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.toml1
-rw-r--r--src/lib.rs8
2 files changed, 8 insertions, 1 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 3bfe654..7500897 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,3 +7,4 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
+serde_yaml = "0.8.9"
diff --git a/src/lib.rs b/src/lib.rs
index c73dde5..6886727 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -89,7 +89,7 @@ impl Roadmap {
}
/// Create a new roadmap from a YAML representation.
- pub fn from_yaml(_yaml: String) -> Result<Roadmap, Box<dyn std::error::Error>> {
+ pub fn from_yaml(_yaml: &str) -> Result<Roadmap, Box<dyn std::error::Error>> {
Ok(Roadmap::new())
}
@@ -225,4 +225,10 @@ first -> second;
}
");
}
+
+ #[test]
+ fn from_empty_yaml() {
+ let roadmap = Roadmap::from_yaml("{}").unwrap();
+ assert_eq!(roadmap.step_names().len(), 0);
+ }
}