Skip to content

Commit f803288

Browse files
the10thWizSergioBenitez
authored andcommitted
Update tests to set secret key so they work on release
1 parent 8243004 commit f803288

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

core/lib/tests/drop-in-async-context.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#[macro_use]
22
extern crate rocket;
33

4-
use rocket::{build, fairing::AdHoc, Build, Orbit, Rocket};
4+
use figment::Figment;
5+
use rocket::{custom, fairing::AdHoc, Build, Orbit, Rocket, config::SecretKey};
56

67
struct AsyncDropInAsync;
78

@@ -16,7 +17,10 @@ impl Drop for AsyncDropInAsync {
1617
}
1718

1819
fn rocket() -> Rocket<Build> {
19-
build().manage(AsyncDropInAsync).attach(AdHoc::on_liftoff(
20+
let mut config = rocket::Config::default();
21+
config.secret_key = SecretKey::generate().unwrap();
22+
let figment = Figment::from(config);
23+
custom(figment).manage(AsyncDropInAsync).attach(AdHoc::on_liftoff(
2024
"Shutdown immediately",
2125
|rocket: &Rocket<Orbit>| {
2226
Box::pin(async {

0 commit comments

Comments
 (0)