-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathmod.rs
87 lines (79 loc) · 2.56 KB
/
mod.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
use crate::{e2e_test, eq, eq_re};
e2e_test!(init, |dir| {
dir.command().arg("init").output();
let stdout = dir.command().arg("init").stdout();
eq_re!("PATH", stdout);
eq_re!("FRUM_MULTISHELL_PATH", stdout);
eq_re!("FRUM_DIR", stdout);
eq_re!("FRUM_LOGLEVEL", stdout);
eq_re!("FRUM_RUBY_BUILD_MIRROR", stdout);
eq_re!("frum --log-level quiet local", stdout);
});
e2e_test!(use_installed_version, |dir| {
dir.command().arg("install").arg("2.7.0").output();
dir.command().arg("local").arg("2.7.0").output();
eq_re!("^ruby 2.7.0", dir.ruby_version());
dir.command().arg("global").arg("2.7.0").output();
eq_re!("^ruby 2.7.0", dir.ruby_version());
});
e2e_test!(use_not_installed_version, |dir| {
eq!(
"error: Requested version 2.7.0 is not currently installed\n",
dir.command().arg("local").arg("2.7.0").stderr()
);
});
e2e_test!(uninstall_installed_version, |dir| {
dir.command().arg("install").arg("3.0.1").output();
assert!(dir.path().join("versions").join("3.0.1").exists());
dir.command().arg("uninstall").arg("3.0.1").output();
assert!(!dir.path().join("versions").join("3.0.1").exists());
});
e2e_test!(uninstall_not_installed_version, |dir| {
dir.command().arg("install").arg("2.7.0").output();
eq!(
"error: Can't find version: 2.6.5\n",
dir.command().arg("uninstall").arg("2.6.5").stderr()
);
});
e2e_test!(use_version_specified_in_ruby_version_file, |dir| {
eq!(
"error: Can't find version in dotfiles. Please provide a version manually to the command.\n",
dir.command().arg("local").stderr()
);
eq!(
"",
dir.command()
.arg("--log-level")
.arg("quiet")
.arg("local")
.stderr()
);
});
e2e_test!(install_ruby_in_specific_base_dir, |dir| {
let base_dir = dir.path().join("foo");
dir.command()
.arg("--frum-dir")
.arg(&base_dir)
.arg("install")
.arg("2.7.0")
.output();
dir.command()
.arg("--frum-dir")
.arg(&base_dir)
.arg("local")
.arg("2.7.0")
.output();
assert!(base_dir.join("versions").exists());
});
e2e_test!(use_configure_opts, |dir| {
dir.command()
.arg("install")
.arg("2.7.1")
.arg("--disable-werror")
.arg("--without-gmp")
.output();
dir.command().arg("local").arg("2.7.1").output();
let configure_opts = dir.ruby_configure_options();
eq_re!("--disable-werror", configure_opts);
eq_re!("--with-openssl-dir", configure_opts);
});