diff --git a/src/job.rs b/src/job.rs index 504c5e2..1f99e49 100644 --- a/src/job.rs +++ b/src/job.rs @@ -16,6 +16,7 @@ pub struct Job { pub last_run: Option, pub output_file: Option, pub channel: Option, + pub source_file: Option, } impl Job { @@ -28,6 +29,7 @@ impl Job { last_run: None, output_file: None, channel: None, + source_file: None, }; } @@ -106,6 +108,7 @@ impl Job { if job.output_file.is_none() { job.set_default_output_file(conf); } + job.source_file = Some(PathBuf::from(path)); return Ok(job); } @@ -208,6 +211,7 @@ selector = section.listing:nth-child(2) > ul:nth-child(1) > li:nth-child(3) > he assert_eq!(job.output_file.unwrap().to_str().unwrap(), "results.d/http:--example.com-test.rss"); assert_eq!(job.every.as_secs(), 7200); assert_eq!(job.selector, "section.listing:nth-child(2) > ul:nth-child(1) > li:nth-child(3) > header:nth-child(3) > h2:nth-child(1) > a:nth-child(1)"); + assert_eq!(job.source_file.unwrap().to_str(), tf.path().to_str()); } }