Sha256: ecd1a01e28384971c43d037ffe8fc72b6da5ba55a34708b704720f521cfd318a
Contents?: true
Size: 581 Bytes
Versions: 9
Compression:
Stored size: 581 Bytes
Contents
require 'gir_ffi_test_helper' describe GirFFI::FFIExt::Pointer do let(:klass) { Class.new { include GirFFI::FFIExt::Pointer } } describe "#to_object" do it "finds the wrapping class by gtype and wraps the pointer in it" do ptr = klass.new mock(ptr).null? { false } object_class = Class.new mock(GObject).type_from_instance_pointer(ptr) { 0xdeadbeef } mock(GirFFI::Builder).build_by_gtype(0xdeadbeef) { object_class } mock(object_class).direct_wrap(ptr) { "good-result" } ptr.to_object.must_equal "good-result" end end end
Version data entries
9 entries across 9 versions & 1 rubygems