mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-20 12:45:05 +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>
|
||||
</Properties>
|
||||
</Item>
|
||||
</roblox>
|
||||
</roblox>
|
||||
@@ -38,4 +38,4 @@ expression: contents
|
||||
</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 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);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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]"
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user