File tree Expand file tree Collapse file tree 2 files changed +27
-4
lines changed Expand file tree Collapse file tree 2 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ impl SharedSettings {
172
172
. get_one :: < TableStyle > ( "table_style" )
173
173
. cloned ( )
174
174
. or ( Some ( TableStyle :: default ( ) ) )
175
- . unwrap_or ( TableStyle :: default ( ) ) ;
175
+ . unwrap_or_default ( ) ;
176
176
177
177
Self {
178
178
tls : should_use_tls,
@@ -235,7 +235,7 @@ impl SharedSettings {
235
235
. get_one :: < TableStyle > ( "table_style" )
236
236
. cloned ( )
237
237
. or ( Some ( TableStyle :: default ( ) ) )
238
- . unwrap_or ( TableStyle :: default ( ) ) ;
238
+ . unwrap_or_default ( ) ;
239
239
240
240
Self {
241
241
tls : should_use_tls,
@@ -305,7 +305,7 @@ impl SharedSettings {
305
305
. get_one :: < TableStyle > ( "table_style" )
306
306
. cloned ( )
307
307
. or ( Some ( TableStyle :: default ( ) ) )
308
- . unwrap_or ( TableStyle :: default ( ) ) ;
308
+ . unwrap_or_default ( ) ;
309
309
310
310
Self {
311
311
tls : should_use_tls,
@@ -367,7 +367,7 @@ impl SharedSettings {
367
367
. get_one :: < TableStyle > ( "table_style" )
368
368
. cloned ( )
369
369
. or ( Some ( TableStyle :: default ( ) ) )
370
- . unwrap_or ( TableStyle :: default ( ) ) ;
370
+ . unwrap_or_default ( ) ;
371
371
372
372
Self {
373
373
tls : should_use_tls,
Original file line number Diff line number Diff line change @@ -37,3 +37,26 @@ fn test_list_users() -> Result<(), Box<dyn std::error::Error>> {
37
37
38
38
Ok ( ( ) )
39
39
}
40
+
41
+ #[ test]
42
+ fn test_list_users_with_table_styles ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
43
+ let username = "new_user" ;
44
+ let password = "pa$$w0rd" ;
45
+ run_succeeds ( [
46
+ "declare" ,
47
+ "user" ,
48
+ "--name" ,
49
+ username,
50
+ "--password" ,
51
+ password,
52
+ ] ) ;
53
+
54
+ run_succeeds ( [ "--table-style" , "markdown" , "list" , "users" ] )
55
+ . stdout ( predicate:: str:: contains ( username) ) ;
56
+ run_succeeds ( [ "delete" , "user" , "--name" , username] ) ;
57
+
58
+ run_succeeds ( [ "--table-style" , "borderless" , "list" , "users" ] )
59
+ . stdout ( predicate:: str:: contains ( username) . not ( ) ) ;
60
+
61
+ Ok ( ( ) )
62
+ }
You can’t perform that action at this time.
0 commit comments