mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-23 22:25:26 +00:00
Move rojo-test snapshots into partitioned folders
This commit is contained in:
@@ -11,4 +11,4 @@ expression: contents
|
|||||||
<string name="Source">return "From folder/init.lua"</string>
|
<string name="Source">return "From folder/init.lua"</string>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Item>
|
</Item>
|
||||||
</roblox>
|
</roblox>
|
||||||
@@ -38,4 +38,4 @@ expression: contents
|
|||||||
</Item>
|
</Item>
|
||||||
</Item>
|
</Item>
|
||||||
</Item>
|
</Item>
|
||||||
</roblox>
|
</roblox>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
use std::{fs, process::Command};
|
use std::{fs, path::Path, process::Command};
|
||||||
|
|
||||||
use insta::assert_snapshot;
|
use insta::assert_snapshot;
|
||||||
use tempfile::tempdir;
|
use tempfile::tempdir;
|
||||||
@@ -12,6 +12,7 @@ macro_rules! gen_build_tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn [<build_ $test_name>]() {
|
fn [<build_ $test_name>]() {
|
||||||
let _ = env_logger::try_init();
|
let _ = env_logger::try_init();
|
||||||
|
|
||||||
run_build_test(stringify!($test_name));
|
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");
|
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);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use std::{
|
use std::{
|
||||||
fs,
|
fs,
|
||||||
path::PathBuf,
|
path::{Path, PathBuf},
|
||||||
process::Command,
|
process::Command,
|
||||||
sync::atomic::{AtomicUsize, Ordering},
|
sync::atomic::{AtomicUsize, Ordering},
|
||||||
};
|
};
|
||||||
@@ -18,11 +18,18 @@ use crate::util::{
|
|||||||
fn empty() {
|
fn empty() {
|
||||||
let _ = env_logger::try_init();
|
let _ = env_logger::try_init();
|
||||||
|
|
||||||
let mut session = TestServeSession::new("empty");
|
let mut settings = insta::Settings::new();
|
||||||
let info = session.wait_to_come_online();
|
|
||||||
|
|
||||||
assert_yaml_snapshot!(info, {
|
let snapshot_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("serve-test-snapshots");
|
||||||
".sessionId" => "[session id]"
|
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]"
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user