aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests/repository/vcs/git_bitbucket_driver_test.rs
blob: e48c60927d231f9d67525b5a18484f129dcf33f9 (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
//! ref: composer/tests/Composer/Test/Repository/Vcs/GitBitbucketDriverTest.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::GitBitbucketDriver;

#[test]
fn test_supports() {
    let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new()));
    let config = Rc::new(RefCell::new(Config::new(true, None)));

    assert!(
        GitBitbucketDriver::supports(
            io.clone(),
            config.clone(),
            "https://bitbucket.org/user/repo.git",
            false
        )
        .unwrap()
    );

    // should not be changed, see https://github.com/composer/composer/issues/9400
    assert!(
        !GitBitbucketDriver::supports(
            io.clone(),
            config.clone(),
            "git@bitbucket.org:user/repo.git",
            false
        )
        .unwrap()
    );

    assert!(
        !GitBitbucketDriver::supports(io, config, "https://github.com/user/repo.git", false)
            .unwrap()
    );
}

// The remaining cases construct a GitBitbucketDriver and mock the HttpDownloader to return
// Bitbucket API responses; mocking is not available, and a real HttpDownloader reaches
// curl_multi_init (todo!()).
#[test]
#[ignore = "constructs a GitBitbucketDriver and mocks the HttpDownloader (curl_multi_init todo!())"]
fn test_get_root_identifier_wrong_scm_type() {
    todo!()
}

#[test]
#[ignore = "constructs a GitBitbucketDriver and mocks the HttpDownloader (curl_multi_init todo!())"]
fn test_driver() {
    todo!()
}

#[test]
#[ignore = "constructs a GitBitbucketDriver and mocks the HttpDownloader (curl_multi_init todo!())"]
fn test_get_params() {
    todo!()
}

#[test]
#[ignore = "constructs a GitBitbucketDriver and mocks the HttpDownloader (curl_multi_init todo!())"]
fn test_initialize_invalid_repository_url() {
    todo!()
}

#[test]
#[ignore = "constructs a GitBitbucketDriver and mocks the HttpDownloader (curl_multi_init todo!())"]
fn test_invalid_support_data() {
    todo!()
}