mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-20 12:45:05 +00:00
Require a Rojo project again (#307)
This commit is contained in:
committed by
GitHub
parent
691a8fcdeb
commit
f43777e37e
6
rojo-test/build-tests/deep_nesting/default.project.json
Normal file
6
rojo-test/build-tests/deep_nesting/default.project.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "deep_nesting",
|
||||
"tree": {
|
||||
"$path": "src"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "init_with_children",
|
||||
"tree": {
|
||||
"$path": "src"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
This is a bare text file with no project.
|
||||
6
rojo-test/build-tests/rbxmx_ref/default.project.json
Normal file
6
rojo-test/build-tests/rbxmx_ref/default.project.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "rbxmx_ref",
|
||||
"tree": {
|
||||
"$path": "model.rbxmx"
|
||||
}
|
||||
}
|
||||
6
rojo-test/serve-tests/add_folder/default.project.json
Normal file
6
rojo-test/serve-tests/add_folder/default.project.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "add_folder",
|
||||
"tree": {
|
||||
"$path": "src"
|
||||
}
|
||||
}
|
||||
6
rojo-test/serve-tests/edit_init/default.project.json
Normal file
6
rojo-test/serve-tests/edit_init/default.project.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "edit_init",
|
||||
"tree": {
|
||||
"$path": "src"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
Hello, world!
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "move_folder_of_stuff",
|
||||
"tree": {
|
||||
"$path": "src"
|
||||
}
|
||||
}
|
||||
6
rojo-test/serve-tests/remove_file/default.project.json
Normal file
6
rojo-test/serve-tests/remove_file/default.project.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "remove_file",
|
||||
"tree": {
|
||||
"$path": "src"
|
||||
}
|
||||
}
|
||||
6
rojo-test/serve-tests/scripts/default.project.json
Normal file
6
rojo-test/serve-tests/scripts/default.project.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "scripts",
|
||||
"tree": {
|
||||
"$path": "src"
|
||||
}
|
||||
}
|
||||
@@ -35,12 +35,12 @@ gen_build_tests! {
|
||||
json_model_legacy_name,
|
||||
module_in_folder,
|
||||
module_init,
|
||||
plain_gitkeep,
|
||||
rbxm_in_folder,
|
||||
rbxmx_in_folder,
|
||||
script_meta_disabled,
|
||||
server_in_folder,
|
||||
server_init,
|
||||
rbxmx_ref,
|
||||
txt,
|
||||
txt_in_folder,
|
||||
}
|
||||
@@ -52,16 +52,6 @@ gen_build_tests! {
|
||||
ignore_glob_spec,
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn build_plain_txt() {
|
||||
run_build_test("plain.txt");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn build_rbxmx_ref() {
|
||||
run_build_test("rbxmx_ref.rbxmx");
|
||||
}
|
||||
|
||||
fn run_build_test(test_name: &str) {
|
||||
let build_test_path = get_build_tests_path();
|
||||
let working_dir = get_working_dir_path();
|
||||
|
||||
@@ -35,7 +35,7 @@ fn scripts() {
|
||||
read_response.intern_and_redact(&mut redactions, root_id)
|
||||
);
|
||||
|
||||
fs::write(session.path().join("foo.lua"), "Updated foo!").unwrap();
|
||||
fs::write(session.path().join("src/foo.lua"), "Updated foo!").unwrap();
|
||||
|
||||
let subscribe_response = session.get_api_subscribe(0).unwrap();
|
||||
assert_yaml_snapshot!(
|
||||
@@ -51,26 +51,6 @@ fn scripts() {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn just_txt() {
|
||||
run_serve_test("just_txt.txt", |session, mut redactions| {
|
||||
let info = session.get_api_rojo().unwrap();
|
||||
let root_id = info.root_instance_id;
|
||||
|
||||
assert_yaml_snapshot!("just_txt_info", redactions.redacted_yaml(info));
|
||||
|
||||
let read_response = session.get_api_read(root_id).unwrap();
|
||||
assert_yaml_snapshot!(
|
||||
"just_txt_all",
|
||||
read_response.intern_and_redact(&mut redactions, root_id)
|
||||
);
|
||||
|
||||
fs::write(session.path(), "Changed content!").unwrap();
|
||||
|
||||
// TODO: Directly served files currently don't trigger changed events!
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn add_folder() {
|
||||
run_serve_test("add_folder", |session, mut redactions| {
|
||||
@@ -85,7 +65,7 @@ fn add_folder() {
|
||||
read_response.intern_and_redact(&mut redactions, root_id)
|
||||
);
|
||||
|
||||
fs::create_dir(session.path().join("my-new-folder")).unwrap();
|
||||
fs::create_dir(session.path().join("src/my-new-folder")).unwrap();
|
||||
|
||||
let subscribe_response = session.get_api_subscribe(0).unwrap();
|
||||
assert_yaml_snapshot!(
|
||||
@@ -115,7 +95,7 @@ fn remove_file() {
|
||||
read_response.intern_and_redact(&mut redactions, root_id)
|
||||
);
|
||||
|
||||
fs::remove_file(session.path().join("hello.txt")).unwrap();
|
||||
fs::remove_file(session.path().join("src/hello.txt")).unwrap();
|
||||
|
||||
let subscribe_response = session.get_api_subscribe(0).unwrap();
|
||||
assert_yaml_snapshot!(
|
||||
@@ -145,7 +125,7 @@ fn edit_init() {
|
||||
read_response.intern_and_redact(&mut redactions, root_id)
|
||||
);
|
||||
|
||||
fs::write(session.path().join("init.lua"), b"-- Edited contents").unwrap();
|
||||
fs::write(session.path().join("src/init.lua"), b"-- Edited contents").unwrap();
|
||||
|
||||
let subscribe_response = session.get_api_subscribe(0).unwrap();
|
||||
assert_yaml_snapshot!(
|
||||
@@ -191,7 +171,7 @@ fn move_folder_of_stuff() {
|
||||
|
||||
// We're hoping that this rename gets picked up as one event. This test
|
||||
// will fail otherwise.
|
||||
fs::rename(stuff_path, session.path().join("new-stuff")).unwrap();
|
||||
fs::rename(stuff_path, session.path().join("src/new-stuff")).unwrap();
|
||||
|
||||
let subscribe_response = session.get_api_subscribe(0).unwrap();
|
||||
assert_yaml_snapshot!(
|
||||
|
||||
Reference in New Issue
Block a user