Skip to content

Commit

Permalink
feat(#41): puzzle for extends with
Browse files Browse the repository at this point in the history
  • Loading branch information
h1alexbel committed Jun 25, 2024
1 parent 444c153 commit 9c67f53
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/src/report/latex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ use std::path::Path;
/// ```
pub fn template(path: Option<&str>) -> String {
return fs::read_to_string(Path::new(path.unwrap_or("resources/report.tex")))
.expect("template should be read from");
.unwrap_or_else(|_| panic!("the world is ending: {}", path.unwrap().to_owned()));
}

#[cfg(test)]
Expand All @@ -54,6 +54,10 @@ mod tests {
use crate::report::latex::template;

#[test]
// @todo #41:60min Add support of @ExtendsWith from JUnit in order to pass expected as test parameter.
// We should use extensions in order to pass expected as parameters into
// test. If there is no crate with such functionality - let's develop and
// release one.
fn returns_default_template() -> Result<()> {
let content = template(None);
let expected = r"\usepackage{to-be-determined}
Expand Down

0 comments on commit 9c67f53

Please sign in to comment.