File tree 3 files changed +13
-11
lines changed
3 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 15
15
16
16
steps :
17
17
- uses : actions/checkout@v3
18
+
18
19
- name : Build
19
20
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
+
20
27
- name : Run tests
21
28
run : cargo test --verbose
Original file line number Diff line number Diff line change
1
+ use assert_cmd:: prelude:: OutputAssertExt ;
1
2
use assert_fs:: {
2
3
prelude:: { FileWriteStr , PathAssert , PathChild } ,
3
4
TempDir ,
4
5
} ;
5
6
use std:: process:: Command ;
6
7
7
8
fn run_git_command ( dir : & TempDir , subcommand : & str , args : Vec < & str > ) {
8
- let output = Command :: new ( "git" )
9
+ Command :: new ( "git" )
9
10
. current_dir ( & dir)
10
11
. arg ( subcommand)
11
12
. 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 ( ) ;
20
15
}
21
16
22
17
// TODO: Tidy, builder pattern?
Original file line number Diff line number Diff line change @@ -45,12 +45,12 @@ fn propagates_invalid_git_target_error() {
45
45
Command :: cargo_bin ( "git-step" )
46
46
. unwrap ( )
47
47
. args ( [ "-C" , temp_dir. to_str ( ) . unwrap ( ) ] )
48
- . arg ( "master " )
48
+ . arg ( "lorem " )
49
49
. assert ( )
50
50
. failure ( )
51
51
. code ( 1 )
52
52
. 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" ,
54
54
) ) ;
55
55
}
56
56
You can’t perform that action at this time.
0 commit comments