Skip to content

Commit 9b931c7

Browse files
committed
test: migrate owner to snapbox
1 parent 3a088c8 commit 9b931c7

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

tests/testsuite/owner.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
//! Tests for the `cargo owner` command.
22
3-
#![allow(deprecated)]
4-
53
use std::fs;
64

75
use cargo_test_support::paths::CargoPathExt;
86
use cargo_test_support::project;
97
use cargo_test_support::registry::{self, api_path};
8+
use cargo_test_support::str;
109

1110
fn setup(name: &str, content: Option<&str>) {
1211
let dir = api_path().join(format!("api/v1/crates/{}", name));
@@ -51,12 +50,11 @@ fn simple_list() {
5150

5251
p.cargo("owner -l")
5352
.replace_crates_io(registry.index_url())
54-
.with_stdout(
55-
"\
53+
.with_stdout_data(str![[r#"
5654
github:rust-lang:core (Core)
5755
octocat
58-
",
59-
)
56+
57+
"#]])
6058
.run();
6159
}
6260

@@ -83,13 +81,14 @@ fn simple_add() {
8381
p.cargo("owner -a username")
8482
.replace_crates_io(registry.index_url())
8583
.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
8987
9088
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+
"#]])
9392
.run();
9493
}
9594

@@ -149,14 +148,15 @@ fn simple_remove() {
149148
p.cargo("owner -r username")
150149
.replace_crates_io(registry.index_url())
151150
.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
156155
157156
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+
"#]])
160160
.run();
161161
}
162162

0 commit comments

Comments
 (0)