Sha256: 5dba931e14f61e960b451c0abdfe4aa6b5a3f81d07ea6cda287ae20ae7d8fb00

Contents?: true

Size: 901 Bytes

Versions: 13

Compression:

Stored size: 901 Bytes

Contents

require 'gir_ffi_test_helper'

GirFFI.setup :Regress

describe GirFFI::Builders::RegisteredTypeBuilder do
  describe '#setup_instance_method' do
    it 'restores a method that was removed' do
      Regress::TestObj.class_eval { remove_method 'instance_method' }

      builder = Regress::TestObj.gir_ffi_builder

      builder.setup_instance_method 'instance_method'

      obj = Regress::TestObj.constructor
      obj.must_respond_to 'instance_method'
    end

    it 'returns the name of the generated method' do
      builder = Regress::TestObj.gir_ffi_builder
      result = builder.setup_instance_method 'instance_method'
      result.must_equal 'instance_method'
    end

    it 'returns the name of the generated method if different from the info name' do
      builder = GLib::IConv.gir_ffi_builder
      result = builder.setup_instance_method ''
      result.must_equal '_'
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
gir_ffi-0.9.2 test/gir_ffi/builders/registered_type_builder_test.rb
gir_ffi-0.9.1 test/gir_ffi/builders/registered_type_builder_test.rb
gir_ffi-0.9.0 test/gir_ffi/builders/registered_type_builder_test.rb
gir_ffi-0.8.6 test/gir_ffi/builders/registered_type_builder_test.rb
gir_ffi-0.8.5 test/gir_ffi/builders/registered_type_builder_test.rb
gir_ffi-0.8.4 test/gir_ffi/builders/registered_type_builder_test.rb
gir_ffi-0.8.3 test/gir_ffi/builders/registered_type_builder_test.rb
gir_ffi-0.8.2 test/gir_ffi/builders/registered_type_builder_test.rb
gir_ffi-0.8.1 test/gir_ffi/builders/registered_type_builder_test.rb
gir_ffi-0.8.0 test/gir_ffi/builders/registered_type_builder_test.rb
gir_ffi-0.7.10 test/gir_ffi/builders/registered_type_builder_test.rb
gir_ffi-0.7.9 test/gir_ffi/builders/registered_type_builder_test.rb
gir_ffi-0.7.8 test/gir_ffi/builders/registered_type_builder_test.rb