gobject-introspection 3.4.4 → 3.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/test/test-loader.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2012-2021 Ruby-GNOME Project Team
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -17,14 +17,60 @@
17
17
  class TestLoaderInfo < Test::Unit::TestCase
18
18
  def setup
19
19
  @repository = GObjectIntrospection::Repository.default
20
- @repository.require("Gio")
21
- @info = @repository.find("Gio", "Application")
22
- @sandbox = Module.new
23
20
  end
24
21
 
25
22
  def test_define_class
26
- gtype = @info.gtype
27
- GObjectIntrospection::Loader.define_class(gtype, "Application", @sandbox)
28
- assert_equal(gtype, @sandbox::Application.gtype)
23
+ info = @repository.find("Gio", "Application")
24
+ gtype = info.gtype
25
+ assert_equal(gtype, Gio::Application.gtype)
26
+ end
27
+
28
+ sub_test_case("virtual function") do
29
+ def test_without_prefix
30
+ active_vfs_class = Class.new(Gio::Vfs) do
31
+ type_register("ActiveVfsWithoutPrefix")
32
+
33
+ def virtual_do_is_active
34
+ true
35
+ end
36
+ end
37
+ active_vfs = active_vfs_class.new
38
+ assert do
39
+ active_vfs.active?
40
+ end
41
+ end
42
+
43
+ def test_with_prefix
44
+ active_vfs_class = Class.new(Gio::Vfs) do
45
+ type_register("ActiveVfsWithPrefix")
46
+
47
+ def virtual_do_gvfs_is_active
48
+ true
49
+ end
50
+ end
51
+ active_vfs = active_vfs_class.new
52
+ assert do
53
+ active_vfs.active?
54
+ end
55
+ end
56
+
57
+ def test_interface
58
+ resettable_converter_class = Class.new(GLib::Object) do
59
+ type_register("ResettableConverter")
60
+
61
+ include Gio::Converter
62
+
63
+ attr_reader :resetted
64
+
65
+ def virtual_do_reset
66
+ @resetted = true
67
+ end
68
+ end
69
+ resettable_converter = resettable_converter_class.new
70
+ resettable_converter.reset
71
+ assert do
72
+ resettable_converter.resetted
73
+ end
74
+ end
29
75
  end
30
76
  end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2012-2021 Ruby-GNOME Project Team
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -113,6 +113,10 @@ class TestObjectInfo < Test::Unit::TestCase
113
113
  assert_equal(0, @info.n_constants)
114
114
  end
115
115
 
116
+ def test_class_struct
117
+ assert_equal("FileOutputStreamClass", @info.class_struct.name)
118
+ end
119
+
116
120
  def test_unref_function
117
121
  assert_nil(@info.unref_function)
118
122
  end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012-2014 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2012-2021 Ruby-GNOME Project Team
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -30,6 +30,11 @@ class TestStructInfo < Test::Unit::TestCase
30
30
  @info.get_field(0))
31
31
  end
32
32
 
33
+ def test_find_field
34
+ assert_equal("g_type",
35
+ @info.find_field("g_type").name)
36
+ end
37
+
33
38
  def test_n_methods
34
39
  assert_operator(@info.n_methods, :>=, 62)
35
40
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gobject-introspection
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.4
4
+ version: 3.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Ruby-GNOME Project Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-22 00:00:00.000000000 Z
11
+ date: 2021-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glib2
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.4.4
19
+ version: 3.4.5
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 3.4.4
26
+ version: 3.4.5
27
27
  description: Ruby/GObjectIntrospection provides bindings of GObject Introspection
28
28
  and a loader module that can generate dynamically Ruby bindings of any GObject C
29
29
  libraries