Skip to content

Commit

Permalink
chore: get tests passing again even if I don't need them atm
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Simpson committed Apr 27, 2020
1 parent fe3cfcc commit 4e20ce1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ pub struct Episode {
}

impl Episode {
fn return_episode_number(&self) -> String {
pub fn return_episode_number(&self) -> String {
let length = self.nola_episode.len();
self.nola_episode[6..length].to_string()
}

fn return_season_number(&self) -> String {
pub fn return_season_number(&self) -> String {
self.nola_episode[4..6].to_string()
}

Expand All @@ -71,7 +71,7 @@ impl Episode {

#[derive(Debug, Deserialize, Clone)]
pub struct Video {
url: String,
bitrate: Option<String>,
format: Option<String>,
pub url: String,
pub bitrate: Option<String>,
pub format: Option<String>,
}
12 changes: 6 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ mod tests {

#[test]
fn season_number() {
let video: Video = Video {
let video: json::Video = json::Video {
url: "https://url.com".to_string(),
bitrate: Some("720p".to_string()),
format: Some("mp4".to_string()),
};
let test: Episode = Episode {
let test: json::Episode = json::Episode {
id: "123".to_string(),
nola_episode: "SAST4921".to_string(),
videos: vec![video],
Expand All @@ -65,12 +65,12 @@ mod tests {

#[test]
fn episode_number() {
let video: Video = Video {
let video: json::Video = json::Video {
url: "https://url.com".to_string(),
bitrate: Some("720p".to_string()),
format: Some("mp4".to_string()),
};
let test: Episode = Episode {
let test: json::Episode = json::Episode {
id: "123".to_string(),
nola_episode: "SAST4921".to_string(),
videos: vec![video],
Expand All @@ -79,13 +79,13 @@ mod tests {

assert_eq!(test.return_episode_number(), "21");

let dtvideo: Video = Video {
let dtvideo: json::Video = json::Video {
url: "https://url.com".to_string(),
bitrate: Some("720p".to_string()),
format: Some("mp4".to_string()),
};

let dtest: Episode = Episode {
let dtest: json::Episode = json::Episode {
id: "123".to_string(),
nola_episode: "DTIG101".to_string(),
videos: vec![dtvideo],
Expand Down

0 comments on commit 4e20ce1

Please sign in to comment.