blob: f4881823544abf9b8fe2d5a272eb9ebfb7ba29bf (
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
|
//! ref: composer/tests/Composer/Test/Repository/Vcs/ForgejoDriverTest.php
use std::cell::RefCell;
use std::rc::Rc;
use shirabe::config::Config;
use shirabe::io::IOInterface;
use shirabe::io::null_io::NullIO;
use shirabe::repository::vcs::ForgejoDriver;
fn supports_provider() -> Vec<(bool, &'static str)> {
vec![
(false, "https://example.org/acme/repo"),
(true, "https://codeberg.org/acme/repository"),
]
}
#[test]
#[ignore = "ForgejoDriver::supports uses a regex with a character class the regex crate cannot compile (unclosed character class)"]
fn test_supports() {
for (expected, repo_url) in supports_provider() {
let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new()));
let config = Rc::new(RefCell::new(Config::new(true, None)));
assert_eq!(
expected,
ForgejoDriver::supports(io, config, repo_url, false).unwrap()
);
}
}
// The remaining cases construct a ForgejoDriver and mock the HttpDownloader to return
// Forgejo API responses; mocking is not available, and a real HttpDownloader reaches
// curl_multi_init (todo!()).
#[test]
#[ignore = "constructs a ForgejoDriver and mocks the HttpDownloader (curl_multi_init todo!())"]
fn test_public_repository() {
todo!()
}
#[test]
#[ignore = "constructs a ForgejoDriver and mocks the HttpDownloader (curl_multi_init todo!())"]
fn test_get_branches() {
todo!()
}
#[test]
#[ignore = "constructs a ForgejoDriver and mocks the HttpDownloader (curl_multi_init todo!())"]
fn test_get_tags() {
todo!()
}
#[test]
#[ignore = "constructs a ForgejoDriver and mocks the HttpDownloader (curl_multi_init todo!())"]
fn test_get_empty_file_content() {
todo!()
}
|