Skip to content

Commit

Permalink
refactor: change public to static
Browse files Browse the repository at this point in the history
  • Loading branch information
chesedo committed Nov 30, 2022
1 parent f68d055 commit 28f93f3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions resources/static-folder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ impl ResourceBuilder<PathBuf> for StaticFolder {
factory: &mut dyn Factory,
_runtime: &Runtime,
) -> Result<PathBuf, shuttle_service::Error> {
let input_dir = factory.get_build_path().join("public");
let output_dir = factory.get_storage_path().join("public");
let input_dir = factory.get_build_path().join("static");
let output_dir = factory.get_storage_path().join("static");

rename(input_dir, output_dir.clone())?;

Expand Down Expand Up @@ -81,11 +81,11 @@ mod tests {
async fn copies_folder() {
let mut factory = MockFactory::new();

let input_file_path = factory.build_path.path().join("public").join("note.txt");
let input_file_path = factory.build_path.path().join("static").join("note.txt");
fs::create_dir_all(input_file_path.parent().unwrap()).unwrap();
fs::write(input_file_path, "Hello, test!").unwrap();

let expected_file = factory.storage_path.path().join("public").join("note.txt");
let expected_file = factory.storage_path.path().join("static").join("note.txt");
assert!(!expected_file.exists(), "input file should not exist yet");

// Call plugin
Expand All @@ -96,7 +96,7 @@ mod tests {

assert_eq!(
actual_folder,
factory.storage_path.path().join("public"),
factory.storage_path.path().join("static"),
"expect path to the static folder"
);
assert!(expected_file.exists(), "expected input file to be created");
Expand Down

0 comments on commit 28f93f3

Please sign in to comment.