Sha256: 24a09f984f609349c014e4f204abe5f6e8002f62b2383d906d1e19e54bbbb9a3

Contents?: true

Size: 661 Bytes

Versions: 3

Compression:

Stored size: 661 Bytes

Contents

require 'gir_ffi_test_helper'

describe GirFFI::CallbackBase do
  describe '.store_callback' do
    it 'stores the passed in proc in CALLBACKS' do
      dummy_proc = 'some-callback'
      GirFFI::CallbackBase.store_callback dummy_proc
      GirFFI::CallbackBase::CALLBACKS[dummy_proc.object_id].must_equal dummy_proc
    end
  end

  describe '.drop_callback' do
    it 'removes the corresponding proc from CALLBACKS' do
      dummy_proc = 'some-callback'
      GirFFI::CallbackBase.store_callback dummy_proc
      GirFFI::CallbackBase.drop_callback dummy_proc.object_id
      GirFFI::CallbackBase::CALLBACKS[dummy_proc.object_id].must_be_nil
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gir_ffi-0.9.2 test/gir_ffi/callback_base_test.rb
gir_ffi-0.9.1 test/gir_ffi/callback_base_test.rb
gir_ffi-0.9.0 test/gir_ffi/callback_base_test.rb