Skip to content

Commit 199d18d

Browse files
committed
shift test data to include another scenario
1 parent c7912e2 commit 199d18d

File tree

13 files changed

+8
-11
lines changed

13 files changed

+8
-11
lines changed

kondo-lib/src/lib_test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#[cfg(test)]
22
mod test {
3-
// use kondo_lib::{Project, ProjectType, ScanOptions};
43
use std::path::PathBuf;
54
use tempfile;
65

76
use crate::{Project, ProjectType, ScanOptions};
87

8+
// Given test data, clean should remove some files
99
#[test]
1010
fn test_clean() {
1111
let scan_options: ScanOptions = ScanOptions {
@@ -14,7 +14,7 @@ mod test {
1414
};
1515

1616
let tempdir = get_copy_of_test_data_as_temp_dir();
17-
let path = tempdir.path().join("test_data/test_discover");
17+
let path = tempdir.path().join("test_data/scenario_a");
1818

1919
// Given 2 py projects with content cached
2020
let project_a = Project {

kondo/src/main_test.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mod test {
99
fn test_discover() {
1010
// given a directory with two projects
1111
let tempdir = get_copy_of_test_data_as_temp_dir();
12-
let path = tempdir.path().join("test_data/test_discover");
12+
let path = tempdir.path().join("test_data");
1313

1414
// and basic setup
1515
let scan_options: ScanOptions = ScanOptions {
@@ -34,17 +34,16 @@ mod test {
3434
count += 1;
3535
}
3636

37-
// ought to find two projects
38-
assert_eq!(count, 2);
37+
// ought to find the right number of projects
38+
assert_eq!(count, 3);
3939

4040
// clean up
4141
tempdir.close().unwrap();
4242
}
4343

44-
4544
fn get_copy_of_test_data_as_temp_dir() -> tempfile::TempDir {
4645
extern crate fs_extra;
47-
let options = fs_extra::dir::CopyOptions::new();
46+
let options = fs_extra::dir::CopyOptions::new();
4847

4948
let mut path: PathBuf = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
5049
path.push("../test_data");
@@ -59,5 +58,4 @@ mod test {
5958

6059
return tmp_dir;
6160
}
62-
6361
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# empty example is enough to signal this is a cargo project

0 commit comments

Comments
 (0)