Sha256: 77b00419d23036217730eaad8f32e45b91eb6977611f246bd90fd3443fe250b5

Contents?: true

Size: 562 Bytes

Versions: 19

Compression:

Stored size: 562 Bytes

Contents

use magnus::{prelude::*, rb_assert, Value};

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

    let val: Value = magnus::eval!(
        ruby,
        "
    class Test
      def each
         yield 1
         yield 2
         yield 3
      end
    end
    Test.new
    "
    )
    .unwrap();

    let enumerator = val.enumeratorize("each", ());

    rb_assert!(ruby, "enumerator.next == 1", enumerator);
    rb_assert!(ruby, "enumerator.next == 2", enumerator);
    rb_assert!(ruby, "enumerator.next == 3", enumerator);
}

Version data entries

19 entries across 19 versions & 1 rubygems

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