blob: 0c45d2ce75336e966edcdf3e5db96ea9ede08d58 (
plain)
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
88
89
|
//! ref: composer/tests/Composer/Test/Downloader/FossilDownloaderTest.php
use shirabe::util::filesystem::Filesystem;
use tempfile::TempDir;
fn set_up() -> TempDir {
TempDir::new().unwrap()
}
fn tear_down(working_dir: &std::path::Path) {
if working_dir.is_dir() {
let mut fs = Filesystem::new(None);
fs.remove_directory(working_dir).unwrap();
}
}
struct TearDown {
working_dir: std::path::PathBuf,
}
impl TearDown {
fn new(working_dir: std::path::PathBuf) -> Self {
TearDown { working_dir }
}
}
impl Drop for TearDown {
fn drop(&mut self) {
tear_down(&self.working_dir);
}
}
// Every case constructs a FossilDownloader with a mocked IO/Config and a mocked
// ProcessExecutor to feed fossil command output; a real HttpDownloader reaches
// curl_multi_init (todo!()), and ProcessExecutor mocking is not available.
#[test]
#[ignore = "needs ProcessExecutorMock and PHPUnit mocks of IOInterface/PackageInterface/Filesystem for getDownloaderMock; not available"]
fn test_install_for_package_without_source_reference() {
let working_dir = set_up();
let _tear_down = TearDown::new(working_dir.path().to_path_buf());
let _ = &working_dir;
todo!()
}
#[test]
#[ignore = "needs ProcessExecutorMock with expects() command-sequence assertions and PHPUnit PackageInterface mock; not available"]
fn test_install() {
let working_dir = set_up();
let _tear_down = TearDown::new(working_dir.path().to_path_buf());
let _ = &working_dir;
todo!()
}
#[test]
#[ignore = "needs ProcessExecutorMock and PHPUnit mocks of IOInterface/PackageInterface/Filesystem for getDownloaderMock; not available"]
fn test_updatefor_package_without_source_reference() {
let working_dir = set_up();
let _tear_down = TearDown::new(working_dir.path().to_path_buf());
let _ = &working_dir;
todo!()
}
#[test]
#[ignore = "needs ProcessExecutorMock with expects() command-sequence assertions and PHPUnit PackageInterface mock; not available"]
fn test_update() {
let working_dir = set_up();
let _tear_down = TearDown::new(working_dir.path().to_path_buf());
let _ = &working_dir;
todo!()
}
#[test]
#[ignore = "needs ProcessExecutorMock and a PHPUnit Filesystem mock asserting removeDirectoryAsync; not available"]
fn test_remove() {
let working_dir = set_up();
let _tear_down = TearDown::new(working_dir.path().to_path_buf());
let _ = &working_dir;
todo!()
}
#[test]
#[ignore = "needs ProcessExecutorMock and PHPUnit mocks of IOInterface/Filesystem for getDownloaderMock; not available"]
fn test_get_installation_source() {
let working_dir = set_up();
let _tear_down = TearDown::new(working_dir.path().to_path_buf());
let _ = &working_dir;
todo!()
}
|