mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-20 20:55:50 +00:00
Add test for ensuring that scripts can be disabled with .meta.json files
This commit is contained in:
@@ -243,4 +243,27 @@ mod test {
|
||||
|
||||
assert_yaml_snapshot!(instance_snapshot);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn script_disabled() {
|
||||
let mut imfs = Imfs::new(NoopFetcher);
|
||||
let file = ImfsSnapshot::file("Hello there!");
|
||||
let meta = ImfsSnapshot::file(
|
||||
r#"
|
||||
{
|
||||
"properties": {
|
||||
"Disabled": true
|
||||
}
|
||||
}
|
||||
"#,
|
||||
);
|
||||
|
||||
imfs.debug_load_snapshot("/bar.server.lua", file);
|
||||
imfs.debug_load_snapshot("/bar.meta.json", meta);
|
||||
|
||||
let entry = imfs.get("/bar.server.lua").unwrap();
|
||||
let instance_snapshot = SnapshotLua::from_imfs(&mut imfs, &entry).unwrap().unwrap();
|
||||
|
||||
assert_yaml_snapshot!(instance_snapshot);
|
||||
}
|
||||
}
|
||||
|
||||
22
src/snapshot_middleware/snapshots/test__script_disabled.snap
Normal file
22
src/snapshot_middleware/snapshots/test__script_disabled.snap
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
source: src/snapshot_middleware/lua.rs
|
||||
expression: instance_snapshot
|
||||
---
|
||||
snapshot_id: ~
|
||||
metadata:
|
||||
ignore_unknown_instances: false
|
||||
instigating_source:
|
||||
Path: /bar.server.lua
|
||||
relevant_paths:
|
||||
- /bar.server.lua
|
||||
- /bar.meta.json
|
||||
name: bar
|
||||
class_name: Script
|
||||
properties:
|
||||
Disabled:
|
||||
Type: Bool
|
||||
Value: true
|
||||
Source:
|
||||
Type: String
|
||||
Value: Hello there!
|
||||
children: []
|
||||
Reference in New Issue
Block a user