Sha256: f50a6ad3c0677ffb846290aeb1f2c6e202fdebc27109286fdfb2e7b3b870042d

Contents?: true

Size: 418 Bytes

Versions: 19

Compression:

Stored size: 418 Bytes

Contents

use magnus::{function, rb_assert, Ruby};

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

    ruby.define_global_function("make_proc", function!(Ruby::block_proc, 0));

    rb_assert!(ruby, "Proc === make_proc { 1 + 1 }");
    rb_assert!(ruby, "(make_proc { 1 + 1 }).call == 2");
    rb_assert!(
        ruby,
        "begin; make_proc; rescue => e; end; ArgumentError === e"
    );
}

Version data entries

19 entries across 19 versions & 1 rubygems

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