1
1
//! Tests for the `cargo owner` command.
2
2
3
- #![ allow( deprecated) ]
4
-
5
3
use std:: fs;
6
4
7
5
use cargo_test_support:: paths:: CargoPathExt ;
8
6
use cargo_test_support:: project;
9
7
use cargo_test_support:: registry:: { self , api_path} ;
8
+ use cargo_test_support:: str;
10
9
11
10
fn setup ( name : & str , content : Option < & str > ) {
12
11
let dir = api_path ( ) . join ( format ! ( "api/v1/crates/{}" , name) ) ;
@@ -51,12 +50,11 @@ fn simple_list() {
51
50
52
51
p. cargo ( "owner -l" )
53
52
. replace_crates_io ( registry. index_url ( ) )
54
- . with_stdout (
55
- "\
53
+ . with_stdout_data ( str![ [ r#"
56
54
github:rust-lang:core (Core)
57
55
octocat
58
- " ,
59
- )
56
+
57
+ "# ] ] )
60
58
. run ( ) ;
61
59
}
62
60
@@ -83,13 +81,14 @@ fn simple_add() {
83
81
p. cargo ( "owner -a username" )
84
82
. replace_crates_io ( registry. index_url ( ) )
85
83
. with_status ( 101 )
86
- . with_stderr (
87
- " Updating crates.io index
88
- error: failed to invite owners to crate `foo` on registry at file://[..]
84
+ . with_stderr_data ( str! [ [ r#"
85
+ [UPDATING] crates.io index
86
+ [ERROR] failed to invite owners to crate `foo` on registry at [ROOTURL]/api
89
87
90
88
Caused by:
91
- EOF while parsing a value at line 1 column 0" ,
92
- )
89
+ EOF while parsing a value at line 1 column 0
90
+
91
+ "# ] ] )
93
92
. run ( ) ;
94
93
}
95
94
@@ -149,14 +148,15 @@ fn simple_remove() {
149
148
p. cargo ( "owner -r username" )
150
149
. replace_crates_io ( registry. index_url ( ) )
151
150
. with_status ( 101 )
152
- . with_stderr (
153
- " Updating crates.io index
154
- Owner removing [\ " username\ " ] from crate foo
155
- error: failed to remove owners from crate `foo` on registry at file://[..]
151
+ . with_stderr_data ( str! [ [ r#"
152
+ [UPDATING] crates.io index
153
+ [OWNER] removing ["username"] from crate foo
154
+ [ERROR] failed to remove owners from crate `foo` on registry at [ROOTURL]/api
156
155
157
156
Caused by:
158
- EOF while parsing a value at line 1 column 0" ,
159
- )
157
+ EOF while parsing a value at line 1 column 0
158
+
159
+ "# ] ] )
160
160
. run ( ) ;
161
161
}
162
162
0 commit comments