Skip to content

Commit e1a5f7d

Browse files
committed
Test CLI's --remote option
1 parent 0607eed commit e1a5f7d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/main.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,21 @@ fn test_run_json() {
4444
assert_eq!(out, expected);
4545
}
4646

47+
#[test]
48+
fn test_run_remote() {
49+
if which("git").is_err() {
50+
return;
51+
}
52+
let origin = GHRepo::new("octocat", "repository").unwrap();
53+
let upstream = GHRepo::new("sourcedog", "repository").unwrap();
54+
let maker = RepoMaker::new();
55+
maker.init("trunk");
56+
maker.add_remote("origin", &origin.ssh_url());
57+
maker.add_remote("upstream", &upstream.clone_url());
58+
let out = readcmd(&["--remote", "upstream", maker.path().to_str().unwrap()]);
59+
assert_eq!(out, "sourcedog/repository");
60+
}
61+
4762
#[test]
4863
fn test_run_empty() {
4964
if which("git").is_err() {

0 commit comments

Comments
 (0)