Sha256: 2bf663f15b841b0bd6ddcc8d9b0cb6ff9d5ccf2243c64e4037cae3a82483d9b0

Contents?: true

Size: 484 Bytes

Versions: 19

Compression:

Stored size: 484 Bytes

Contents

use magnus::RArray;

#[test]
fn it_converts_to_array() {
    let ruby = unsafe { magnus::embed::init() };

    assert!(ruby.eval::<RArray>("[]").is_ok());
    assert!(ruby.eval::<RArray>("[nil]").is_ok());
    assert!(ruby.eval::<RArray>("[1, 2]").is_ok());
    assert!(ruby.eval::<RArray>(r#"["foo", "bar", "baz"]"#).is_ok());

    assert!(ruby.eval::<RArray>("nil").is_err());
    assert!(ruby.eval::<RArray>("1").is_err());
    assert!(ruby.eval::<RArray>(r#""foo""#).is_err());
}

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/magnus-0.7.1/tests/try_convert_array.rs
wasmtime-28.0.0 ./ext/cargo-vendor/magnus-0.7.1/tests/try_convert_array.rs
wasmtime-27.0.0 ./ext/cargo-vendor/magnus-0.7.1/tests/try_convert_array.rs
wasmtime-26.0.0 ./ext/cargo-vendor/magnus-0.7.1/tests/try_convert_array.rs
wasmtime-25.0.2 ./ext/cargo-vendor/magnus-0.6.4/tests/try_convert_array.rs
wasmtime-25.0.1 ./ext/cargo-vendor/magnus-0.6.4/tests/try_convert_array.rs
wasmtime-25.0.0 ./ext/cargo-vendor/magnus-0.6.4/tests/try_convert_array.rs
wasmtime-24.0.0 ./ext/cargo-vendor/magnus-0.6.4/tests/try_convert_array.rs
wasmtime-23.0.2 ./ext/cargo-vendor/magnus-0.6.4/tests/try_convert_array.rs
wasmtime-22.0.0 ./ext/cargo-vendor/magnus-0.6.4/tests/try_convert_array.rs
wasmtime-21.0.1 ./ext/cargo-vendor/magnus-0.6.4/tests/try_convert_array.rs
wasmtime-20.0.2 ./ext/cargo-vendor/magnus-0.6.4/tests/try_convert_array.rs
wasmtime-20.0.0 ./ext/cargo-vendor/magnus-0.6.4/tests/try_convert_array.rs
wasmtime-18.0.3 ./ext/cargo-vendor/magnus-0.6.2/tests/try_convert_array.rs
wasmtime-17.0.1 ./ext/cargo-vendor/magnus-0.6.2/tests/try_convert_array.rs
wasmtime-17.0.0 ./ext/cargo-vendor/magnus-0.6.2/tests/try_convert_array.rs
wasmtime-16.0.0 ./ext/cargo-vendor/magnus-0.6.2/tests/try_convert_array.rs
wasmtime-15.0.1 ./ext/cargo-vendor/magnus-0.6.2/tests/try_convert_array.rs
wasmtime-15.0.0 ./ext/cargo-vendor/magnus-0.6.2/tests/try_convert_array.rs