Sha256: 438b49e0376bf8162a3cccb0ab35709f689b420dbe542db079c905388d556eeb

Contents?: true

Size: 839 Bytes

Versions: 4

Compression:

Stored size: 839 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" }

    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

4 entries across 4 versions & 1 rubygems

Version Path
gir_ffi-0.15.3 test/ffi-gobject_introspection/i_constant_info_test.rb
gir_ffi-0.15.2 test/ffi-gobject_introspection/i_constant_info_test.rb
gir_ffi-0.15.1 test/ffi-gobject_introspection/i_constant_info_test.rb
gir_ffi-0.15.0 test/ffi-gobject_introspection/i_constant_info_test.rb