-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test: remove unused code * test: main * test: helpers functions * test: space between test methods * test: fix space between test
- Loading branch information
Showing
4 changed files
with
71 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -235,14 +235,37 @@ pub struct Release { | |
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
const BASE_PARACHAIN: &str = "https://github.com/r0gue-io/base-parachain"; | ||
const POLKADOT_SDK: &str = "https://github.com/paritytech/polkadot-sdk"; | ||
|
||
#[test] | ||
fn test_parse_org() -> Result<(), Box<dyn std::error::Error>> { | ||
let url = Url::parse(BASE_PARACHAIN)?; | ||
let org = GitHub::org(&url)?; | ||
assert_eq!(org, "r0gue-io"); | ||
Ok(()) | ||
} | ||
|
||
#[test] | ||
fn test_parse_name() -> Result<(), Box<dyn std::error::Error>> { | ||
let url = Url::parse(BASE_PARACHAIN)?; | ||
let name = GitHub::name(&url)?; | ||
assert_eq!(name, "base-parachain"); | ||
Ok(()) | ||
} | ||
|
||
#[test] | ||
fn test_release_url() -> Result<(), Box<dyn std::error::Error>> { | ||
let repo = Url::parse(POLKADOT_SDK)?; | ||
let url = GitHub::release(&repo, &format!("polkadot-v1.9.0"), "polkadot"); | ||
assert_eq!(url, format!("{}/releases/download/polkadot-v1.9.0/polkadot", POLKADOT_SDK)); | ||
Ok(()) | ||
} | ||
|
||
#[test] | ||
fn test_convert_to_ssh_url() { | ||
assert_eq!( | ||
GitHub::convert_to_ssh_url( | ||
&Url::parse("https://github.com/r0gue-io/base-parachain") | ||
.expect("valid repository url") | ||
), | ||
GitHub::convert_to_ssh_url(&Url::parse(BASE_PARACHAIN).expect("valid repository url")), | ||
"[email protected]:r0gue-io/base-parachain.git" | ||
); | ||
assert_eq!( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters