Sha256: a40fcc8fd1393711ab9d4e5ecc13ef0bcd38080eceaf02b747252b4e7b8a188b

Contents?: true

Size: 728 Bytes

Versions: 7

Compression:

Stored size: 728 Bytes

Contents

# frozen_string_literal: true

require 'gir_ffi_test_helper'

require 'ffi-gobject'
describe GObject::ParamSpec do
  let(:pspec) do
    GObject.param_spec_int('foo-bar', 'foo bar',
                           'Foo Bar',
                           1, 3, 2,
                           readable: true, writable: true)
  end

  describe '#ref' do
    it 'increases the ref count' do
      old = pspec.ref_count
      pspec.ref
      pspec.ref_count.must_equal old + 1
    end
  end

  describe '#accessor_name' do
    it 'returns a safe ruby method name' do
      pspec.accessor_name.must_equal 'foo_bar'
    end
  end

  it 'cannot be instantiated directly' do
    proc { GObject::ParamSpec.new }.must_raise NoMethodError
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
gir_ffi-0.13.1 test/ffi-gobject/param_spec_test.rb
gir_ffi-0.13.0 test/ffi-gobject/param_spec_test.rb
gir_ffi-0.12.1 test/ffi-gobject/param_spec_test.rb
gir_ffi-0.12.0 test/ffi-gobject/param_spec_test.rb
gir_ffi-0.11.4 test/ffi-gobject/param_spec_test.rb
gir_ffi-0.11.3 test/ffi-gobject/param_spec_test.rb
gir_ffi-0.11.2 test/ffi-gobject/param_spec_test.rb