i5-add-tests (part 3) #9
4 changed files with 8 additions and 5 deletions
4
src/file/mod.rs
Normal file
4
src/file/mod.rs
Normal file
|
@ -0,0 +1,4 @@
|
|||
mod env;
|
||||
pub mod read;
|
||||
|
||||
pub use env::FileEnv;
|
|
@ -27,7 +27,7 @@ mod tests {
|
|||
//given
|
||||
let (dir, file_name) = create_text_file(
|
||||
"subscriptions.txt",
|
||||
include_bytes!("../test/data/subscriptions.txt"),
|
||||
include_bytes!("../../test/data/subscriptions.txt"),
|
||||
)?;
|
||||
let file_env = FileEnv::default();
|
||||
|
||||
|
@ -45,7 +45,7 @@ mod tests {
|
|||
//given
|
||||
let (dir, file_name) = create_text_file(
|
||||
"subscriptions.txt",
|
||||
include_bytes!("../test/data/subscriptions-blank-line.txt"),
|
||||
include_bytes!("../../test/data/subscriptions-blank-line.txt"),
|
||||
)?;
|
||||
let file_env = FileEnv::default();
|
||||
|
||||
|
@ -63,7 +63,7 @@ mod tests {
|
|||
//given
|
||||
let (dir, file_name) = create_text_file(
|
||||
"subscriptions.txt",
|
||||
include_bytes!("../test/data/subscriptions-comment.txt"),
|
||||
include_bytes!("../../test/data/subscriptions-comment.txt"),
|
||||
)?;
|
||||
let file_env = FileEnv::default();
|
||||
|
|
@ -4,7 +4,6 @@ pub mod fetch;
|
|||
pub mod file;
|
||||
pub mod history;
|
||||
pub mod prelude;
|
||||
mod subscriptions;
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_utils;
|
||||
|
@ -23,7 +22,7 @@ pub struct Env {
|
|||
}
|
||||
|
||||
pub fn run(subscriptions: &str, history: &str, site: &str, e: Env) -> Result<()> {
|
||||
for channel_name in subscriptions::lines_from(subscriptions, &e.file)? {
|
||||
for channel_name in file::read::lines_from(subscriptions, &e.file)? {
|
||||
println!("Channel: {}", channel_name);
|
||||
let feed_url = (e.feed.find)(site, &channel_name, &e.fetch.get)?;
|
||||
for entry in (e.feed.get)(&feed_url)?.entries() {
|
||||
|
|
Loading…
Add table
Reference in a new issue