From e55b72f73f879c299c7aec4ef49497ee661f6026 Mon Sep 17 00:00:00 2001 From: Lucien Greathouse Date: Thu, 17 Oct 2019 16:01:03 -0700 Subject: [PATCH] rojo-test: Move settings closer to where settings are applied --- rojo-test/src/serve_util.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/rojo-test/src/serve_util.rs b/rojo-test/src/serve_util.rs index c0c67c1f..8ea23800 100644 --- a/rojo-test/src/serve_util.rs +++ b/rojo-test/src/serve_util.rs @@ -28,12 +28,6 @@ use crate::util::{ pub fn run_serve_test(test_name: &str, callback: impl FnOnce(TestServeSession, RedactionMap)) { let _ = env_logger::try_init(); - let mut settings = insta::Settings::new(); - - let snapshot_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("serve-test-snapshots"); - settings.set_snapshot_path(snapshot_path); - settings.set_sort_maps(true); - let mut redactions = RedactionMap::new(); let mut session = TestServeSession::new(test_name); @@ -42,6 +36,11 @@ pub fn run_serve_test(test_name: &str, callback: impl FnOnce(TestServeSession, R redactions.intern(info.session_id); redactions.intern(info.root_instance_id); + let mut settings = insta::Settings::new(); + + let snapshot_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("serve-test-snapshots"); + settings.set_snapshot_path(snapshot_path); + settings.set_sort_maps(true); settings.bind(move || callback(session, redactions)); }