mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-23 06:05:24 +00:00
Add init scripts as relevant paths to all directories.
This doesn't feel ideal. Though it's true that all directories are influenced by any init scripts they have, the directory middleware shouldn't need to know about Lua. I don't really want to go back into working on the middleware chain since it mostly feels like busywork when there are other things to build on in Rojo. also all of this feels really complicated
This commit is contained in:
@@ -204,6 +204,24 @@ mod test {
|
||||
assert_yaml_snapshot!(instance_snapshot);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn init_module_from_vfs() {
|
||||
let mut vfs = Vfs::new(NoopFetcher);
|
||||
let dir = VfsSnapshot::dir(hashmap! {
|
||||
"init.lua" => VfsSnapshot::file("Hello!"),
|
||||
});
|
||||
|
||||
vfs.debug_load_snapshot("/root", dir);
|
||||
|
||||
let entry = vfs.get("/root").unwrap();
|
||||
let instance_snapshot =
|
||||
SnapshotLua::from_vfs(&mut InstanceSnapshotContext::default(), &mut vfs, &entry)
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
|
||||
assert_yaml_snapshot!(instance_snapshot);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn module_with_meta() {
|
||||
let mut vfs = Vfs::new(NoopFetcher);
|
||||
|
||||
Reference in New Issue
Block a user