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:
Lucien Greathouse
2019-11-18 18:28:36 -08:00
parent 715022def5
commit 246fd5f6c4
10 changed files with 76 additions and 1 deletions

View File

@@ -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);