Move rojo-test snapshots into partitioned folders

This commit is contained in:
Lucien Greathouse
2019-09-03 18:11:28 -07:00
parent ea765eb929
commit 9383240627
24 changed files with 24 additions and 9 deletions

View File

@@ -11,4 +11,4 @@ expression: contents
<string name="Source">return "From folder/init.lua"</string>
</Properties>
</Item>
</roblox>
</roblox>

View File

@@ -38,4 +38,4 @@ expression: contents
</Item>
</Item>
</Item>
</roblox>
</roblox>

View File

@@ -1,4 +1,4 @@
use std::{fs, process::Command};
use std::{fs, path::Path, process::Command};
use insta::assert_snapshot;
use tempfile::tempdir;
@@ -12,6 +12,7 @@ macro_rules! gen_build_tests {
#[test]
fn [<build_ $test_name>]() {
let _ = env_logger::try_init();
run_build_test(stringify!($test_name));
}
}
@@ -78,5 +79,12 @@ fn run_build_test(test_name: &str) {
let contents = fs::read_to_string(&output_path).expect("Couldn't read output file");
assert_snapshot!(test_name, contents);
let mut settings = insta::Settings::new();
let snapshot_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("build-test-snapshots");
settings.set_snapshot_path(snapshot_path);
settings.bind(|| {
assert_snapshot!(test_name, contents);
});
}

View File

@@ -1,6 +1,6 @@
use std::{
fs,
path::PathBuf,
path::{Path, PathBuf},
process::Command,
sync::atomic::{AtomicUsize, Ordering},
};
@@ -18,11 +18,18 @@ use crate::util::{
fn empty() {
let _ = env_logger::try_init();
let mut session = TestServeSession::new("empty");
let info = session.wait_to_come_online();
let mut settings = insta::Settings::new();
assert_yaml_snapshot!(info, {
".sessionId" => "[session id]"
let snapshot_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("serve-test-snapshots");
settings.set_snapshot_path(snapshot_path);
settings.bind(|| {
let mut session = TestServeSession::new("empty");
let info = session.wait_to_come_online();
assert_yaml_snapshot!(info, {
".sessionId" => "[session id]"
});
});
}