Skip to content

Commit d198774

Browse files
committed
Patched CI
1 parent d623a21 commit d198774

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

.github/workflows/ci.yml

+7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@v3
18+
1819
- name: Build
1920
run: cargo build --verbose
21+
22+
- name: Set git config
23+
run: |
24+
git config --global user.email "<author@example.com>"
25+
git config --global user.name "A U Thor"
26+
2027
- name: Run tests
2128
run: cargo test --verbose

tests/common/mod.rs

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
1+
use assert_cmd::prelude::OutputAssertExt;
12
use assert_fs::{
23
prelude::{FileWriteStr, PathAssert, PathChild},
34
TempDir,
45
};
56
use std::process::Command;
67

78
fn run_git_command(dir: &TempDir, subcommand: &str, args: Vec<&str>) {
8-
let output = Command::new("git")
9+
Command::new("git")
910
.current_dir(&dir)
1011
.arg(subcommand)
1112
.args(args)
12-
.output()
13-
.unwrap();
14-
15-
assert!(
16-
output.status.success(),
17-
"{}",
18-
String::from_utf8_lossy(&output.stdout)
19-
);
13+
.assert()
14+
.success();
2015
}
2116

2217
// TODO: Tidy, builder pattern?

tests/integration.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ fn propagates_invalid_git_target_error() {
4545
Command::cargo_bin("git-step")
4646
.unwrap()
4747
.args(["-C", temp_dir.to_str().unwrap()])
48-
.arg("master")
48+
.arg("lorem")
4949
.assert()
5050
.failure()
5151
.code(1)
5252
.stderr(contains(
53-
"error: pathspec \'master\' did not match any file(s) known to git",
53+
"error: pathspec \'lorem\' did not match any file(s) known to git",
5454
));
5555
}
5656

0 commit comments

Comments
 (0)