Sha256: bac10083f326fec4abfb952e7c2aa6e2ff499d8a8252708cfe6f89eda3d62af3
Contents?: true
Size: 493 Bytes
Versions: 19
Compression:
Stored size: 493 Bytes
Contents
use magnus::{eval, prelude::*, rb_assert, RObject, Value}; #[test] fn it_modifies_ivars() { let ruby = unsafe { magnus::embed::init() }; let val: RObject = eval!(ruby, "$val = Object.new").unwrap(); val.ivar_set("@test", 42).unwrap(); rb_assert!(ruby, "val.instance_variable_get(:@test) == 42", val); let _: Value = eval!(ruby, r#"val.instance_variable_set(:@example, "test")"#, val).unwrap(); assert_eq!("test", val.ivar_get::<_, String>("@example").unwrap()) }
Version data entries
19 entries across 19 versions & 1 rubygems