1
1
use anyhow:: Result ;
2
2
use gix:: { open, Repository , ThreadSafeRepository } ;
3
3
use onefetch:: cli:: { CliOptions , InfoCliOptions , TextFormattingCliOptions } ;
4
+ use onefetch:: config:: ConfigOptions ;
4
5
use onefetch:: info:: { build_info, get_work_dir} ;
5
6
6
7
fn repo ( name : & str ) -> Result < Repository > {
@@ -43,12 +44,13 @@ fn test_repo() -> Result<()> {
43
44
..Default :: default ( )
44
45
} ,
45
46
text_formatting : TextFormattingCliOptions {
46
- iso_time : true ,
47
+ iso_time : Some ( true ) ,
47
48
..Default :: default ( )
48
49
} ,
49
50
..Default :: default ( )
50
51
} ;
51
- let info = build_info ( & config) ?;
52
+ let toml = ConfigOptions :: default ( ) ;
53
+ let info = build_info ( & config, & toml) ?;
52
54
insta:: assert_json_snapshot!(
53
55
info,
54
56
{
@@ -67,7 +69,8 @@ fn test_repo_without_remote() -> Result<()> {
67
69
input : repo. path ( ) . to_path_buf ( ) ,
68
70
..Default :: default ( )
69
71
} ;
70
- let info = build_info ( & config) ;
72
+ let toml = ConfigOptions :: default ( ) ;
73
+ let info = build_info ( & config, & toml) ;
71
74
assert ! ( info. is_ok( ) ) ;
72
75
73
76
Ok ( ( ) )
@@ -80,7 +83,8 @@ fn test_partial_repo() -> Result<()> {
80
83
input : repo. path ( ) . to_path_buf ( ) ,
81
84
..Default :: default ( )
82
85
} ;
83
- let _info = build_info ( & config) . expect ( "no error" ) ;
86
+ let toml = ConfigOptions :: default ( ) ;
87
+ let _info = build_info ( & config, & toml) . expect ( "no error" ) ;
84
88
Ok ( ( ) )
85
89
}
86
90
@@ -91,6 +95,7 @@ fn test_repo_with_pre_epoch_dates() -> Result<()> {
91
95
input : repo. path ( ) . to_path_buf ( ) ,
92
96
..Default :: default ( )
93
97
} ;
94
- let _info = build_info ( & config) . expect ( "no error" ) ;
98
+ let toml = ConfigOptions :: default ( ) ;
99
+ let _info = build_info ( & config, & toml) . expect ( "no error" ) ;
95
100
Ok ( ( ) )
96
101
}
0 commit comments