forked from rojo-rbx/rojo
Add test for #267.
This commit is contained in:
1
rojo-test/serve-tests/edit_init/init.lua
Normal file
1
rojo-test/serve-tests/edit_init/init.lua
Normal file
@@ -0,0 +1 @@
|
||||
-- Original contents
|
||||
@@ -102,7 +102,6 @@ fn add_folder() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
// #[ignore] // TODO: Removing files currently hangs ChangeProcessor
|
||||
fn remove_file() {
|
||||
run_serve_test("remove_file", |session, mut redactions| {
|
||||
let info = session.get_api_rojo().unwrap();
|
||||
@@ -132,6 +131,39 @@ fn remove_file() {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
// Editing an init file currently crashes the ChangeProcessor thread.
|
||||
// https://github.com/rojo-rbx/rojo/issues/267
|
||||
#[ignore]
|
||||
fn edit_init() {
|
||||
run_serve_test("edit_init", |session, mut redactions| {
|
||||
let info = session.get_api_rojo().unwrap();
|
||||
let root_id = info.root_instance_id;
|
||||
|
||||
assert_yaml_snapshot!("edit_init_info", redactions.redacted_yaml(info));
|
||||
|
||||
let read_response = session.get_api_read(root_id).unwrap();
|
||||
assert_yaml_snapshot!(
|
||||
"edit_init_all",
|
||||
read_response.intern_and_redact(&mut redactions, root_id)
|
||||
);
|
||||
|
||||
fs::write(session.path().join("init.lua"), b"-- Edited contents.").unwrap();
|
||||
|
||||
let subscribe_response = session.get_api_subscribe(0).unwrap();
|
||||
assert_yaml_snapshot!(
|
||||
"edit_init_subscribe",
|
||||
subscribe_response.intern_and_redact(&mut redactions, ())
|
||||
);
|
||||
|
||||
let read_response = session.get_api_read(root_id).unwrap();
|
||||
assert_yaml_snapshot!(
|
||||
"edit_init_all-2",
|
||||
read_response.intern_and_redact(&mut redactions, root_id)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn move_folder_of_stuff() {
|
||||
run_serve_test("move_folder_of_stuff", |session, mut redactions| {
|
||||
|
||||
Reference in New Issue
Block a user