Sha256: 7db0330767831e7af4f6789f432fb60a17c4ba6b9c35273276bb985024f877b0

Contents?: true

Size: 894 Bytes

Versions: 9

Compression:

Stored size: 894 Bytes

Contents

# frozen_string_literal: true

require 'introspection_test_helper'

describe GObjectIntrospection::IConstantInfo do
  describe 'for GLib::USEC_PER_SEC, a constant of type :gint32' do
    let(:constant_info) { get_introspection_data 'GLib', 'USEC_PER_SEC' }

    it 'returns :gint32 as its type' do
      assert_equal :gint32, constant_info.constant_type.tag
    end

    it 'returns 1_000_000 as its value' do
      assert_equal 1_000_000, constant_info.value
    end
  end

  describe 'for GLib::SOURCE_CONTINUE, a constant of type :gboolean' do
    let(:constant_info) { get_introspection_data 'GLib', 'SOURCE_CONTINUE' }

    before do
      skip unless constant_info
    end

    it 'returns :gboolean as its type' do
      assert_equal :gboolean, constant_info.constant_type.tag
    end

    it 'returns true as its value' do
      assert_equal true, constant_info.value
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gir_ffi-0.14.1 test/ffi-gobject_introspection/i_constant_info_test.rb
gir_ffi-0.14.0 test/ffi-gobject_introspection/i_constant_info_test.rb
gir_ffi-0.13.1 test/ffi-gobject_introspection/i_constant_info_test.rb
gir_ffi-0.13.0 test/ffi-gobject_introspection/i_constant_info_test.rb
gir_ffi-0.12.1 test/ffi-gobject_introspection/i_constant_info_test.rb
gir_ffi-0.12.0 test/ffi-gobject_introspection/i_constant_info_test.rb
gir_ffi-0.11.4 test/ffi-gobject_introspection/i_constant_info_test.rb
gir_ffi-0.11.3 test/ffi-gobject_introspection/i_constant_info_test.rb
gir_ffi-0.11.2 test/ffi-gobject_introspection/i_constant_info_test.rb