Skip to content

Commit 40226f5

Browse files
committed
update test
1 parent 66168ac commit 40226f5

File tree

1 file changed

+30
-21
lines changed

1 file changed

+30
-21
lines changed

tests/install.rs

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -55,45 +55,54 @@ warning: be sure to add `[..]` to your PATH to be able to run the installed bina
5555
}
5656

5757
#[test]
58-
test!(multiple_pkgs {
58+
fn multiple_pkgs() {
5959
pkg("foo", "0.0.1");
6060
pkg("bar", "0.0.1");
6161

6262
assert_that(cargo_process("install").arg("foo").arg("bar"),
63-
execs().with_status(0).with_stdout(&format!("\
64-
{updating} registry `[..]`
65-
{downloading} foo v0.0.1 (registry file://[..])
66-
{compiling} foo v0.0.1 (registry file://[..])
67-
{installing} {home}[..]bin[..]foo[..]
68-
{downloading} bar v0.0.1 (registry file://[..])
69-
{compiling} bar v0.0.1 (registry file://[..])
70-
{installing} {home}[..]bin[..]bar[..]
63+
execs().with_status(0).with_stderr(&format!("\
64+
[UPDATING] registry `[..]`
65+
[DOWNLOADING] foo v0.0.1 (registry file://[..])
66+
[INSTALLING] foo v0.0.1
67+
[COMPILING] foo v0.0.1
68+
[FINISHED] release [optimized] target(s) in [..]
69+
[INSTALLING] {home}[..]bin[..]foo[..]
70+
warning: be sure to add `[..]` to your PATH to be able to run the installed binaries
71+
[DOWNLOADING] bar v0.0.1 (registry file://[..])
72+
[INSTALLING] bar v0.0.1
73+
[COMPILING] bar v0.0.1
74+
[FINISHED] release [optimized] target(s) in [..]
75+
[INSTALLING] {home}[..]bin[..]bar[..]
76+
warning: be sure to add `[..]` to your PATH to be able to run the installed binaries
77+
78+
79+
SUMMARY
80+
81+
Successfully installed: foo, bar
82+
83+
Errors:
84+
<tab>
7185
",
72-
updating = UPDATING,
73-
downloading = DOWNLOADING,
74-
compiling = COMPILING,
75-
installing = INSTALLING,
7686
home = cargo_home().display())));
7787
assert_that(cargo_home(), has_installed_exe("foo"));
7888
assert_that(cargo_home(), has_installed_exe("bar"));
7989

8090
assert_that(cargo_process("uninstall").arg("foo"),
81-
execs().with_status(0).with_stdout(&format!("\
82-
{removing} {home}[..]bin[..]foo[..]
91+
execs().with_status(0).with_stderr(&format!("\
92+
[REMOVING] {home}[..]bin[..]foo[..]
8393
",
84-
removing = REMOVING,
8594
home = cargo_home().display())));
8695
assert_that(cargo_process("uninstall").arg("bar"),
87-
execs().with_status(0).with_stdout(&format!("\
88-
{removing} {home}[..]bin[..]bar[..]
96+
execs().with_status(0).with_stderr(&format!("\
97+
[REMOVING] {home}[..]bin[..]bar[..]
8998
",
90-
removing = REMOVING,
9199
home = cargo_home().display())));
92100
assert_that(cargo_home(), is_not(has_installed_exe("foo")));
93101
assert_that(cargo_home(), is_not(has_installed_exe("bar")));
94-
});
102+
}
95103

96-
test!(pick_max_version {
104+
#[test]
105+
fn pick_max_version() {
97106
pkg("foo", "0.0.1");
98107
pkg("foo", "0.0.2");
99108

0 commit comments

Comments
 (0)