";
assert_eq!(
- i2.title,
+ i2.title(),
Some("The Breakthrough: Behind the Scenes of Hillary Clinton’s Failed Bid for \
- President".to_string())
+ President")
);
assert_eq!(
- i2.uri,
+ i2.uri(),
"http://tracking.feedpress.it/link/10581/6726759/16_JohnAllen-CRAFT.mp3".to_string(),
);
- assert_eq!(i2.description, Some(descr2.to_string()));
- assert_eq!(i2.length, Some(17964071));
+ assert_eq!(i2.description(), Some(descr2));
+ assert_eq!(i2.length(), Some(17964071));
assert_eq!(
- i2.guid,
+ i2.guid(),
Some(
"https://www.propublica.\
org/podcast/the-breakthrough-hillary-clinton-failed-presidential-bid#133721"
- .to_string(),
)
);
- assert_eq!(
- i2.published_date,
- Some("Fri, 25 Aug 2017 12:00:00 +0000".to_string())
- );
- assert_eq!(i2.epoch, 1503662400);
+ assert_eq!(i2.published_date(), Some("Fri, 25 Aug 2017 12:00:00 +0000"));
+ assert_eq!(i2.epoch(), 1503662400);
}
#[test]
@@ -308,26 +280,16 @@ mod tests {
blaming open source & the Beard just saved the show. It’s a really packed episode!";
let i = new_episode(&firstitem, 0).unwrap();
+ assert_eq!(i.title(), Some("Hacking Devices with Kali Linux | LUP 214"));
assert_eq!(
- i.title,
- Some("Hacking Devices with Kali Linux | LUP 214".to_string())
- );
- assert_eq!(
- i.uri,
+ i.uri(),
"http://www.podtrac.com/pts/redirect.mp3/traffic.libsyn.com/jnite/lup-0214.mp3"
- .to_string(),
);
- assert_eq!(i.description, Some(descr.to_string()));
- assert_eq!(i.length, Some(46479789));
- assert_eq!(
- i.guid,
- Some("78A682B4-73E8-47B8-88C0-1BE62DD4EF9D".to_string())
- );
- assert_eq!(
- i.published_date,
- Some("Tue, 12 Sep 2017 22:24:42 -0700".to_string())
- );
- assert_eq!(i.epoch, 1505280282);
+ assert_eq!(i.description(), Some(descr));
+ assert_eq!(i.length(), Some(46479789));
+ assert_eq!(i.guid(), Some("78A682B4-73E8-47B8-88C0-1BE62DD4EF9D"));
+ assert_eq!(i.published_date(), Some("Tue, 12 Sep 2017 22:24:42 -0700"));
+ assert_eq!(i.epoch(), 1505280282);
let second = channel.items().iter().nth(1).unwrap();
let i2 = new_episode(&second, 0).unwrap();
@@ -338,23 +300,16 @@ mod tests {
future.\n\n
Plus we chat with Wimpy about the Ubuntu Rally in NYC, \
Microsoft’s sneaky move to turn Windows 10 into the “ULTIMATE LINUX \
RUNTIME”, community news & more!
";
- assert_eq!(i2.title, Some("Gnome Does it Again | LUP 213".to_string()));
+ assert_eq!(i2.title(), Some("Gnome Does it Again | LUP 213"));
assert_eq!(
- i2.uri,
+ i2.uri(),
"http://www.podtrac.com/pts/redirect.mp3/traffic.libsyn.com/jnite/lup-0213.mp3"
- .to_string(),
);
- assert_eq!(i2.description, Some(descr2.to_string()));
- assert_eq!(i2.length, Some(36544272));
- assert_eq!(
- i2.guid,
- Some("1CE57548-B36C-4F14-832A-5D5E0A24E35B".to_string())
- );
- assert_eq!(
- i2.published_date,
- Some("Tue, 5 Sep 2017 20:57:27 -0700".to_string())
- );
- assert_eq!(i2.epoch, 1504670247);
+ assert_eq!(i2.description(), Some(descr2));
+ assert_eq!(i2.length(), Some(36544272));
+ assert_eq!(i2.guid(), Some("1CE57548-B36C-4F14-832A-5D5E0A24E35B"));
+ assert_eq!(i2.published_date(), Some("Tue, 5 Sep 2017 20:57:27 -0700"));
+ assert_eq!(i2.epoch(), 1504670247);
}
#[test]
@@ -368,30 +323,20 @@ mod tests {
\"Non-lexical lifetimes\"";
let i = new_episode(&firstitem, 0).unwrap();
+ assert_eq!(i.title(), Some("Episode #9 - A Once in a Lifetime RFC"));
assert_eq!(
- i.title,
- Some("Episode #9 - A Once in a Lifetime RFC".to_string())
- );
- assert_eq!(
- i.uri,
+ i.uri(),
"http://request-for-explanation.github.\
io/podcast/ep9-a-once-in-a-lifetime-rfc/episode.mp3"
- .to_string(),
);
- assert_eq!(i.description, Some(descr.to_string()));
- assert_eq!(i.length, Some(15077388));
+ assert_eq!(i.description(), Some(descr));
+ assert_eq!(i.length(), Some(15077388));
assert_eq!(
- i.guid,
- Some(
- "https://request-for-explanation.github.io/podcast/ep9-a-once-in-a-lifetime-rfc/"
- .to_string(),
- )
+ i.guid(),
+ Some("https://request-for-explanation.github.io/podcast/ep9-a-once-in-a-lifetime-rfc/")
);
- assert_eq!(
- i.published_date,
- Some("Mon, 28 Aug 2017 15:00:00 -0700".to_string())
- );
- assert_eq!(i.epoch, 1503957600);
+ assert_eq!(i.published_date(), Some("Mon, 28 Aug 2017 15:00:00 -0700"));
+ assert_eq!(i.epoch(), 1503957600);
let second = channel.items().iter().nth(8).unwrap();
let i2 = new_episode(&second, 0).unwrap();
@@ -399,29 +344,19 @@ mod tests {
let descr2 = "This week we look at RFC 2071 \"Add \
impl Trait type alias and variable declarations\"";
+ assert_eq!(i2.title(), Some("Episode #8 - An Existential Crisis"));
assert_eq!(
- i2.title,
- Some("Episode #8 - An Existential Crisis".to_string())
- );
- assert_eq!(
- i2.uri,
+ i2.uri(),
"http://request-for-explanation.github.io/podcast/ep8-an-existential-crisis/episode.\
mp3"
- .to_string(),
);
- assert_eq!(i2.description, Some(descr2.to_string()));
- assert_eq!(i2.length, Some(13713219));
+ assert_eq!(i2.description(), Some(descr2));
+ assert_eq!(i2.length(), Some(13713219));
assert_eq!(
- i2.guid,
- Some(
- "https://request-for-explanation.github.io/podcast/ep8-an-existential-crisis/"
- .to_string(),
- )
+ i2.guid(),
+ Some("https://request-for-explanation.github.io/podcast/ep8-an-existential-crisis/")
);
- assert_eq!(
- i2.published_date,
- Some("Tue, 15 Aug 2017 17:00:00 -0700".to_string())
- );
- assert_eq!(i2.epoch, 1502841600);
+ assert_eq!(i2.published_date(), Some("Tue, 15 Aug 2017 17:00:00 -0700"));
+ assert_eq!(i2.epoch(), 1502841600);
}
}