From d8f74b0d12cc02acf1e804ebbe11e058998aea66 Mon Sep 17 00:00:00 2001 From: Jaroslaw Konik Date: Thu, 8 May 2025 23:31:10 +0200 Subject: [PATCH] fix tests --- Cargo.toml | 4 ++-- src/runtimes/ruby.rs | 2 +- tests/tests.rs | 20 ++++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 34eb2db..d5e6c4b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,12 +26,12 @@ rhai = { version = "1.14.0", features = [ thiserror = "1.0.40" anyhow = "1.0.82" tracing = "0.1.40" -lua = { version = "0.9.8", features = [ +mlua = { version = "0.9.8", features = [ "luajit", "vendored", "send", ], optional = true } -magnus = { version = "0.6.4", optional = true } +magnus = { version = "0.7.1", optional = true } [[example]] name = "call_function_from_rust_rhai" diff --git a/src/runtimes/ruby.rs b/src/runtimes/ruby.rs index 15b9a18..293b67a 100644 --- a/src/runtimes/ruby.rs +++ b/src/runtimes/ruby.rs @@ -1,6 +1,6 @@ use bevy::{ asset::Asset, - ecs::{component::Component, schedule::ScheduleLabel, system::Resource}, + ecs::{component::Component, entity::Entity, resource::Resource, schedule::ScheduleLabel}, reflect::TypePath, }; use serde::Deserialize; diff --git a/tests/tests.rs b/tests/tests.rs index 825e6ec..0744ec6 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -1,17 +1,17 @@ -#[cfg(any(feature = "rhai", feature = "lua"))] +#[cfg(any(feature = "rhai", feature = "lua", feature = "ruby"))] use std::sync::OnceLock; -#[cfg(any(feature = "rhai", feature = "lua"))] +#[cfg(any(feature = "rhai", feature = "lua", feature = "ruby"))] use bevy::ecs::system::RunSystemOnce as _; -#[cfg(any(feature = "rhai", feature = "lua"))] +#[cfg(any(feature = "rhai", feature = "lua", feature = "ruby"))] use bevy::prelude::*; -#[cfg(any(feature = "rhai", feature = "lua"))] +#[cfg(any(feature = "rhai", feature = "lua", feature = "ruby"))] use bevy_scriptum::{prelude::*, FuncArgs, Runtime}; -#[cfg(any(feature = "rhai", feature = "lua"))] +#[cfg(any(feature = "rhai", feature = "lua", feature = "ruby"))] static TRACING_SUBSCRIBER: OnceLock<()> = OnceLock::new(); -#[cfg(any(feature = "rhai", feature = "lua"))] +#[cfg(any(feature = "rhai", feature = "lua", feature = "ruby"))] fn build_test_app() -> App { let mut app = App::new(); @@ -25,7 +25,7 @@ fn build_test_app() -> App { app } -#[cfg(any(feature = "rhai", feature = "lua"))] +#[cfg(any(feature = "rhai", feature = "lua", feature = "ruby"))] fn run_script( app: &mut App, path: String, @@ -42,7 +42,7 @@ fn run_script( entity_id } -#[cfg(any(feature = "rhai", feature = "lua"))] +#[cfg(any(feature = "rhai", feature = "lua", feature = "ruby"))] fn call_script_on_update_from_rust( mut scripted_entities: Query<(Entity, &mut R::ScriptData)>, scripting_runtime: ResMut, @@ -55,7 +55,7 @@ fn call_script_on_update_from_rust( .unwrap(); } -#[cfg(any(feature = "rhai", feature = "lua"))] +#[cfg(any(feature = "rhai", feature = "lua", feature = "ruby"))] trait AssertStateKeyValue { type ScriptData; fn assert_state_key_value_i64(world: &World, entity_id: Entity, key: &str, value: i64); @@ -63,7 +63,7 @@ trait AssertStateKeyValue { fn assert_state_key_value_string(world: &World, entity_id: Entity, key: &str, value: &str); } -#[cfg(any(feature = "rhai", feature = "lua"))] +#[cfg(any(feature = "rhai", feature = "lua", feature = "ruby"))] macro_rules! scripting_tests { ($runtime:ty, $script:literal, $extension:literal) => { use super::*;