gir_ffi 0.15.0 → 0.15.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99e99f94ba677daacfe98552b91f5221dea70d33dd992ac53e223e4ff05df898
4
- data.tar.gz: d83b543e6408259e2fa9067faa74c393e117e94148a7d37b7825cfe840537d8e
3
+ metadata.gz: 7fe7307d0aeb897a34c52b3f39d9ad074ea90094e9f0d10efb1a0cc94275d433
4
+ data.tar.gz: 3fe78f8c5332d10b9124ee1ab5a6f316e24f9e8b96e8f1450110e1e7e53feaa3
5
5
  SHA512:
6
- metadata.gz: '02840b2cb293bd64f478f023d7267d20f37f35c24a3a15c9569a04e8f4095cb297d5e9319bd55f1105d8d4cd961c9cab7cc2b01092b1c822f04dab7dc70e9023'
7
- data.tar.gz: 331e901b2c3c94800ad52576dd9127563ae9d41657f947be0543f7ad765e55d0bd64b2ad7642c58b6e36f243d4f5d719047de6d10d15c369cbc49e724b378bd4
6
+ metadata.gz: b98e88240766bff193e05eb33ad47d585968b7d1d1a276f9703ec18a264ef7db083dea3b98f5923284c8a48d196498daaef04c06e63840b225692329730b04d2
7
+ data.tar.gz: 7a6818654b514e14dd7c8a7920446fdceb8471a271bf9184a975e4c6b80d6b6f56bf0596855d4eba0febaf2616eb2422ac43bd4456c1a9263f8cf42f22e25242
data/Changelog.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.15.1 / 2019-10-20
4
+
5
+ * Allow access to properties for unintrospectable classes.
6
+
3
7
  ## 0.15.0 / 2019-10-19
4
8
 
5
9
  * Drop support for gobject-introspection below 1.46, the version available in
@@ -91,8 +91,8 @@ module GirFFI
91
91
  end
92
92
 
93
93
  def ingoing_value_storage
94
- PointerValueConvertor.new(type_spec).
95
- value_to_pointer(call_argument_name, ingoing_convertor.conversion)
94
+ PointerValueConvertor.new(type_spec)
95
+ .value_to_pointer(call_argument_name, ingoing_convertor.conversion)
96
96
  end
97
97
 
98
98
  def has_post_conversion?
@@ -121,8 +121,8 @@ module GirFFI
121
121
  end
122
122
 
123
123
  def sorted_base_argument_builders
124
- @sorted_base_argument_builders ||= @base_argument_builders.
125
- sort_by.with_index { |arg, i| [arg.array_length_idx, i] }
124
+ @sorted_base_argument_builders ||= @base_argument_builders
125
+ .sort_by.with_index { |arg, i| [arg.array_length_idx, i] }
126
126
  end
127
127
 
128
128
  def split_off_block_argument
@@ -281,8 +281,8 @@ module GirFFI
281
281
  private
282
282
 
283
283
  def value_storage(typed_ptr, builder)
284
- PointerValueConvertor.new(field_type_tag).
285
- value_to_pointer(typed_ptr, builder.call_argument_name, info.offset)
284
+ PointerValueConvertor.new(field_type_tag)
285
+ .value_to_pointer(typed_ptr, builder.call_argument_name, info.offset)
286
286
  end
287
287
 
288
288
  def field_type_tag
@@ -42,8 +42,8 @@ module GirFFI
42
42
  end
43
43
 
44
44
  def argument_ffi_types
45
- @argument_ffi_types ||= info.argument_ffi_types.
46
- unshift(receiver_type_info.to_callback_ffi_type)
45
+ @argument_ffi_types ||= info.argument_ffi_types
46
+ .unshift(receiver_type_info.to_callback_ffi_type)
47
47
  end
48
48
 
49
49
  def return_ffi_type
@@ -46,6 +46,10 @@ module GirFFI
46
46
  []
47
47
  end
48
48
 
49
+ def find_property(_any)
50
+ nil
51
+ end
52
+
49
53
  def find_signal(_any)
50
54
  nil
51
55
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Current GirFFI version
4
4
  module GirFFI
5
- VERSION = "0.15.0"
5
+ VERSION = "0.15.1"
6
6
  end
@@ -37,16 +37,16 @@ describe GObject::Object do
37
37
 
38
38
  it "raises an error for a property that does not exist" do
39
39
  instance = GObject::Object.new
40
- _(proc { instance.get_property "foo-bar" }).
41
- must_raise GirFFI::PropertyNotFoundError
40
+ _(proc { instance.get_property "foo-bar" })
41
+ .must_raise GirFFI::PropertyNotFoundError
42
42
  end
43
43
  end
44
44
 
45
45
  describe "#get_property_extended" do
46
46
  it "raises an error for a property that does not exist" do
47
47
  instance = GObject::Object.new
48
- _(proc { instance.get_property_extended "foo-bar" }).
49
- must_raise GirFFI::PropertyNotFoundError
48
+ _(proc { instance.get_property_extended "foo-bar" })
49
+ .must_raise GirFFI::PropertyNotFoundError
50
50
  end
51
51
  end
52
52
 
@@ -60,8 +60,8 @@ describe GObject::Object do
60
60
  describe "#set_property_extended" do
61
61
  it "raises an error for a property that does not exist" do
62
62
  instance = GObject::Object.new
63
- _(proc { instance.set_property_extended "foo-bar", 123 }).
64
- must_raise GirFFI::PropertyNotFoundError
63
+ _(proc { instance.set_property_extended "foo-bar", 123 })
64
+ .must_raise GirFFI::PropertyNotFoundError
65
65
  end
66
66
  end
67
67
 
@@ -5,8 +5,8 @@ require "introspection_test_helper"
5
5
  describe GObjectIntrospection::GObjectTypeInit do
6
6
  describe "Lib" do
7
7
  it "represents the gobject-2.0 library" do
8
- _(GObjectIntrospection::GObjectTypeInit::Lib.ffi_libraries.first.name).
9
- must_match(/gobject-2\.0/)
8
+ _(GObjectIntrospection::GObjectTypeInit::Lib.ffi_libraries.first.name)
9
+ .must_match(/gobject-2\.0/)
10
10
  end
11
11
 
12
12
  it "provides the g_type_init function" do
@@ -69,13 +69,13 @@ describe GObjectIntrospection::IRepository do
69
69
 
70
70
  it "passes its struct pointer to the c function just in case" do
71
71
  gir.require "GObject", "2.0"
72
- allow(GObjectIntrospection::Lib).to receive(:g_irepository_get_dependencies).
73
- and_call_original
72
+ allow(GObjectIntrospection::Lib).to receive(:g_irepository_get_dependencies)
73
+ .and_call_original
74
74
 
75
75
  gir.dependencies("GObject")
76
76
 
77
- expect(GObjectIntrospection::Lib).to have_received(:g_irepository_get_dependencies).
78
- with(gir, "GObject")
77
+ expect(GObjectIntrospection::Lib).to have_received(:g_irepository_get_dependencies)
78
+ .with(gir, "GObject")
79
79
  end
80
80
  end
81
81
  end
@@ -88,8 +88,8 @@ describe GObject do
88
88
 
89
89
  it "does not allow connecting an invalid signal" do
90
90
  o = Regress::TestSubObj.new
91
- _(proc { GObject.signal_connect(o, "not-really-a-signal") {} }).
92
- must_raise GirFFI::SignalNotFoundError
91
+ _(proc { GObject.signal_connect(o, "not-really-a-signal") {} })
92
+ .must_raise GirFFI::SignalNotFoundError
93
93
  end
94
94
 
95
95
  it "handles return values" do
@@ -117,8 +117,8 @@ describe GirFFI::ArgHelper do
117
117
  end
118
118
 
119
119
  it "raises if array does not have the correct size" do
120
- result = _(-> { GirFFI::ArgHelper.check_fixed_array_size(3, [1, 2], "foo") }).
121
- must_raise ArgumentError
120
+ result = _(-> { GirFFI::ArgHelper.check_fixed_array_size(3, [1, 2], "foo") })
121
+ .must_raise ArgumentError
122
122
  _(result.message).must_equal "foo should have size 3"
123
123
  end
124
124
  end
@@ -55,9 +55,9 @@ describe GirFFI::Builder do
55
55
 
56
56
  it "passes the version on to ModuleBuilder" do
57
57
  builder = double(generate: nil)
58
- expect(GirFFI::Builders::ModuleBuilder).to receive(:new).
59
- with("Foo", namespace: "Foo", version: "1.0").
60
- and_return builder
58
+ expect(GirFFI::Builders::ModuleBuilder).to receive(:new)
59
+ .with("Foo", namespace: "Foo", version: "1.0")
60
+ .and_return builder
61
61
 
62
62
  GirFFI::Builder.build_module "Foo", "1.0"
63
63
  end
@@ -100,8 +100,8 @@ describe GirFFI::Builder do
100
100
  end
101
101
 
102
102
  it "refuse to build classes for base types" do
103
- _(-> { GirFFI::Builder.build_by_gtype GObject::TYPE_INT }).
104
- must_raise RuntimeError, "Unable to handle type gint"
103
+ _(-> { GirFFI::Builder.build_by_gtype GObject::TYPE_INT })
104
+ .must_raise RuntimeError, "Unable to handle type gint"
105
105
  end
106
106
  end
107
107
 
@@ -111,12 +111,12 @@ describe GirFFI::Builder do
111
111
  it "calls attach_function with the correct types for Regress.test_callback_destroy_notify" do
112
112
  function_info = get_introspection_data "Regress", "test_callback_destroy_notify"
113
113
 
114
- expect(lib).
115
- to receive(:attach_function).
116
- with("regress_test_callback_destroy_notify",
117
- [Regress::TestCallbackUserData, :pointer, GLib::DestroyNotify],
118
- :int32).
119
- and_return true
114
+ expect(lib)
115
+ .to receive(:attach_function)
116
+ .with("regress_test_callback_destroy_notify",
117
+ [Regress::TestCallbackUserData, :pointer, GLib::DestroyNotify],
118
+ :int32)
119
+ .and_return true
120
120
 
121
121
  GirFFI::Builder.attach_ffi_function(lib, function_info)
122
122
  end
@@ -124,37 +124,37 @@ describe GirFFI::Builder do
124
124
  it "calls attach_function with the correct types for Regress::TestObj#torture_signature_0" do
125
125
  info = get_method_introspection_data "Regress", "TestObj", "torture_signature_0"
126
126
 
127
- expect(lib).
128
- to receive(:attach_function).
129
- with("regress_test_obj_torture_signature_0",
130
- [:pointer, :int32, :pointer, :pointer, :pointer, :pointer, :uint32],
131
- :void).
132
- and_return true
127
+ expect(lib)
128
+ .to receive(:attach_function)
129
+ .with("regress_test_obj_torture_signature_0",
130
+ [:pointer, :int32, :pointer, :pointer, :pointer, :pointer, :uint32],
131
+ :void)
132
+ .and_return true
133
133
 
134
134
  GirFFI::Builder.attach_ffi_function(lib, info)
135
135
  end
136
136
 
137
137
  it "calls attach_function with the correct types for Regress::TestObj#instance_method" do
138
138
  info = get_method_introspection_data "Regress", "TestObj", "instance_method"
139
- expect(lib).to receive(:attach_function).
140
- with("regress_test_obj_instance_method", [:pointer], :int32).
141
- and_return true
139
+ expect(lib).to receive(:attach_function)
140
+ .with("regress_test_obj_instance_method", [:pointer], :int32)
141
+ .and_return true
142
142
  GirFFI::Builder.attach_ffi_function(lib, info)
143
143
  end
144
144
 
145
145
  it "calls attach_function with the correct types for Regress.test_array_gint32_in" do
146
146
  info = get_introspection_data "Regress", "test_array_gint32_in"
147
- expect(lib).to receive(:attach_function).
148
- with("regress_test_array_gint32_in", [:int32, :pointer], :int32).
149
- and_return true
147
+ expect(lib).to receive(:attach_function)
148
+ .with("regress_test_array_gint32_in", [:int32, :pointer], :int32)
149
+ .and_return true
150
150
  GirFFI::Builder.attach_ffi_function(lib, info)
151
151
  end
152
152
 
153
153
  it "calls attach_function with the correct types for Regress.test_enum_param" do
154
154
  info = get_introspection_data "Regress", "test_enum_param"
155
- expect(lib).to receive(:attach_function).
156
- with("regress_test_enum_param", [Regress::TestEnum], :pointer).
157
- and_return true
155
+ expect(lib).to receive(:attach_function)
156
+ .with("regress_test_enum_param", [Regress::TestEnum], :pointer)
157
+ .and_return true
158
158
  GirFFI::Builder.attach_ffi_function(lib, info)
159
159
  end
160
160
 
@@ -14,8 +14,8 @@ describe GirFFI::Builders::ArgumentBuilder do
14
14
  end
15
15
 
16
16
  it "has the correct value for #pre_conversion" do
17
- _(builder.pre_conversion).
18
- must_equal ["_v1 = GirFFI::SizedArray.copy_from([:pointer, GIMarshallingTests::BoxedStruct], -1, structs)"]
17
+ _(builder.pre_conversion)
18
+ .must_equal ["_v1 = GirFFI::SizedArray.copy_from([:pointer, GIMarshallingTests::BoxedStruct], -1, structs)"]
19
19
  end
20
20
 
21
21
  it "has the correct value for #post_conversion" do
@@ -144,8 +144,8 @@ describe GirFFI::Builders::ArgumentBuilder do
144
144
  end
145
145
 
146
146
  it "has the correct value for #post_conversion" do
147
- _(builder.post_conversion).
148
- must_equal ["_v2 = GIMarshallingTests::Object.wrap(_v1.get_pointer(0)).tap { |it| it && it.ref }"]
147
+ _(builder.post_conversion)
148
+ .must_equal ["_v2 = GIMarshallingTests::Object.wrap(_v1.get_pointer(0)).tap { |it| it && it.ref }"]
149
149
  end
150
150
  end
151
151
  end
@@ -163,8 +163,8 @@ describe GirFFI::Builders::ArgumentBuilder do
163
163
  end
164
164
 
165
165
  it "has the correct value for #post_conversion" do
166
- _(builder.post_conversion).
167
- must_equal ["_v2 = GIMarshallingTests::BoxedStruct.wrap_copy(_v1.get_pointer(0))"]
166
+ _(builder.post_conversion)
167
+ .must_equal ["_v2 = GIMarshallingTests::BoxedStruct.wrap_copy(_v1.get_pointer(0))"]
168
168
  end
169
169
  end
170
170
 
@@ -412,9 +412,9 @@ describe GirFFI::Builders::ArgumentBuilder do
412
412
  end
413
413
 
414
414
  it "has the correct value for #pre_conversion" do
415
- _(builder.pre_conversion).
416
- must_equal ["_v1 = FFI::MemoryPointer.new GIMarshallingTests::NoTypeFlags",
417
- "GIMarshallingTests::NoTypeFlags.copy_value_to_pointer(#{arg_info.name}, _v1)"]
415
+ _(builder.pre_conversion)
416
+ .must_equal ["_v1 = FFI::MemoryPointer.new GIMarshallingTests::NoTypeFlags",
417
+ "GIMarshallingTests::NoTypeFlags.copy_value_to_pointer(#{arg_info.name}, _v1)"]
418
418
  end
419
419
 
420
420
  it "has the correct value for #post_conversion" do
@@ -525,8 +525,8 @@ describe GirFFI::Builders::ArgumentBuilder do
525
525
  end
526
526
 
527
527
  it "has the correct value for #post_conversion" do
528
- _(builder.post_conversion).
529
- must_equal ["_v2 = GIMarshallingTests::BoxedStruct.wrap_own(_v1.get_pointer(0))"]
528
+ _(builder.post_conversion)
529
+ .must_equal ["_v2 = GIMarshallingTests::BoxedStruct.wrap_own(_v1.get_pointer(0))"]
530
530
  end
531
531
  end
532
532
  end
@@ -89,15 +89,15 @@ describe GirFFI::Builders::CallbackArgumentBuilder do
89
89
  end
90
90
 
91
91
  it "has the correct value for #pre_conversion" do
92
- _(array_arg_builder.pre_conversion).
93
- must_equal ["_v1 = ints",
94
- "_v2 = GirFFI::SizedArray.wrap(:gint32, _v3, _v1.get_pointer(0))"]
92
+ _(array_arg_builder.pre_conversion)
93
+ .must_equal ["_v1 = ints",
94
+ "_v2 = GirFFI::SizedArray.wrap(:gint32, _v3, _v1.get_pointer(0))"]
95
95
  end
96
96
 
97
97
  it "has the correct value for #post_conversion" do
98
98
  array_arg_builder.pre_conversion
99
- _(array_arg_builder.post_conversion).
100
- must_equal ["_v1.put_pointer 0, GirFFI::SizedArray.from(:gint32, -1, _v4)"]
99
+ _(array_arg_builder.post_conversion)
100
+ .must_equal ["_v1.put_pointer 0, GirFFI::SizedArray.from(:gint32, -1, _v4)"]
101
101
  end
102
102
  end
103
103
 
@@ -111,15 +111,15 @@ describe GirFFI::Builders::CallbackArgumentBuilder do
111
111
  end
112
112
 
113
113
  it "has the correct value for #pre_conversion" do
114
- _(length_arg_builder.pre_conversion).
115
- must_equal ["_v1 = length",
116
- "_v2 = _v1.get_int32(0)"]
114
+ _(length_arg_builder.pre_conversion)
115
+ .must_equal ["_v1 = length",
116
+ "_v2 = _v1.get_int32(0)"]
117
117
  end
118
118
 
119
119
  it "has the correct value for #post_conversion" do
120
120
  length_arg_builder.pre_conversion
121
- _(length_arg_builder.post_conversion).
122
- must_equal ["_v1.put_int32 0, _v3.length"]
121
+ _(length_arg_builder.post_conversion)
122
+ .must_equal ["_v1.put_int32 0, _v3.length"]
123
123
  end
124
124
  end
125
125
  end
@@ -111,8 +111,8 @@ describe GirFFI::Builders::ReturnValueBuilder do
111
111
 
112
112
  it "wraps the result in #post_conversion" do
113
113
  _(builder.capture_variable_name).must_equal "_v1"
114
- _(builder.post_conversion).
115
- must_equal ["_v2 = GIMarshallingTests::Object.wrap(_v1).tap { |it| it && it.ref }"]
114
+ _(builder.post_conversion)
115
+ .must_equal ["_v2 = GIMarshallingTests::Object.wrap(_v1).tap { |it| it && it.ref }"]
116
116
  end
117
117
 
118
118
  it "returns the wrapped result" do
@@ -344,8 +344,8 @@ describe GirFFI::Builders::ReturnValueBuilder do
344
344
 
345
345
  it "autoreleases and converts the result in #post_conversion" do
346
346
  _(builder.capture_variable_name).must_equal "_v1"
347
- _(builder.post_conversion).
348
- must_equal ["_v2 = GirFFI::AllocationHelper.free_after _v1, &:to_utf8"]
347
+ _(builder.post_conversion)
348
+ .must_equal ["_v2 = GirFFI::AllocationHelper.free_after _v1, &:to_utf8"]
349
349
  end
350
350
 
351
351
  it "returns the converted result" do
@@ -69,5 +69,16 @@ describe GirFFI::Builders::UnintrospectableBuilder do
69
69
  _(signal.name).must_equal "handoff"
70
70
  end
71
71
  end
72
+
73
+ describe "its #find_property method" do
74
+ it "returns nil for a property that doesn't exist" do
75
+ _(builder.find_property("foo")).must_be_nil
76
+ end
77
+
78
+ it "finds properies in ancestor classes" do
79
+ property = builder.find_property "name"
80
+ _(property.name).must_equal "name"
81
+ end
82
+ end
72
83
  end
73
84
  end
@@ -75,8 +75,8 @@ describe GirFFI::Builders::VFuncArgumentBuilder do
75
75
  let(:arg_info) { vfunc_info.args[1] }
76
76
 
77
77
  it "has the correct value for #pre_conversion" do
78
- _(builder.pre_conversion).
79
- must_equal ["_v1 = FFI::MemoryPointer.new(:int8).tap { |ptr| out.put_pointer 0, ptr }"]
78
+ _(builder.pre_conversion)
79
+ .must_equal ["_v1 = FFI::MemoryPointer.new(:int8).tap { |ptr| out.put_pointer 0, ptr }"]
80
80
  end
81
81
 
82
82
  it "has the correct value for #post_conversion" do
@@ -90,8 +90,8 @@ describe GirFFI::Builders::VFuncArgumentBuilder do
90
90
  let(:arg_info) { GirFFI::ReceiverArgumentInfo.new(type_info) }
91
91
 
92
92
  it "has the correct value for #pre_conversion" do
93
- _(builder.pre_conversion).
94
- must_equal ["_v1 = GIMarshallingTests::Object.wrap(_instance)"]
93
+ _(builder.pre_conversion)
94
+ .must_equal ["_v1 = GIMarshallingTests::Object.wrap(_instance)"]
95
95
  end
96
96
 
97
97
  it "has the correct value for #post_conversion" do
@@ -54,11 +54,11 @@ describe GirFFI::ObjectBase do
54
54
  end
55
55
 
56
56
  it "finds the ancestor classes and included interface" do
57
- _(derived_class.registered_ancestors).
58
- must_equal [derived_class,
59
- GIMarshallingTests::Interface,
60
- GIMarshallingTests::Object,
61
- GObject::Object]
57
+ _(derived_class.registered_ancestors)
58
+ .must_equal [derived_class,
59
+ GIMarshallingTests::Interface,
60
+ GIMarshallingTests::Object,
61
+ GObject::Object]
62
62
  end
63
63
  end
64
64
  end
@@ -5,13 +5,13 @@ require "gir_ffi_test_helper"
5
5
  describe GirFFI::TypeMap do
6
6
  describe ".type_specification_to_ffi_type" do
7
7
  it "returns the nested FFI::Enum for an Enum module" do
8
- _(GirFFI::TypeMap.type_specification_to_ffi_type(GLib::DateMonth)).
9
- must_equal GLib::DateMonth
8
+ _(GirFFI::TypeMap.type_specification_to_ffi_type(GLib::DateMonth))
9
+ .must_equal GLib::DateMonth
10
10
  end
11
11
 
12
12
  it "returns the class itself for a Struct class" do
13
- _(GirFFI::TypeMap.type_specification_to_ffi_type(GObject::EnumValue)).
14
- must_equal GObject::EnumValue
13
+ _(GirFFI::TypeMap.type_specification_to_ffi_type(GObject::EnumValue))
14
+ .must_equal GObject::EnumValue
15
15
  end
16
16
  end
17
17
  end
@@ -383,8 +383,8 @@ describe GIMarshallingTests do
383
383
  obj = object
384
384
  }
385
385
  end
386
- result = derived_instance.
387
- get_ref_info_for_vfunc_in_object_transfer_full GIMarshallingTests::Object.gtype
386
+ result = derived_instance
387
+ .get_ref_info_for_vfunc_in_object_transfer_full GIMarshallingTests::Object.gtype
388
388
  _(result).must_equal [1, false]
389
389
  _(obj).must_be_instance_of GIMarshallingTests::Object
390
390
  end
@@ -396,8 +396,8 @@ describe GIMarshallingTests do
396
396
  obj = object
397
397
  }
398
398
  end
399
- result = derived_instance.
400
- get_ref_info_for_vfunc_in_object_transfer_none GIMarshallingTests::Object.gtype
399
+ result = derived_instance
400
+ .get_ref_info_for_vfunc_in_object_transfer_none GIMarshallingTests::Object.gtype
401
401
  _(object_ref_count(obj)).must_be :>, 0
402
402
  _(result).must_equal [2, false]
403
403
  _(obj).must_be_instance_of GIMarshallingTests::Object
@@ -584,8 +584,8 @@ describe GIMarshallingTests do
584
584
  result = derived_instance.vfunc_meth_with_error 42
585
585
  _(result).must_equal true
586
586
 
587
- err = _(proc { derived_instance.vfunc_meth_with_error(21) }).
588
- must_raise GirFFI::GLibError
587
+ err = _(proc { derived_instance.vfunc_meth_with_error(21) })
588
+ .must_raise GirFFI::GLibError
589
589
  _(err.message).must_equal "This is not the answer!"
590
590
  _(err.domain).must_equal "gir_ffi"
591
591
  _(err.code).must_equal 0
@@ -608,8 +608,8 @@ describe GIMarshallingTests do
608
608
  :vfunc_one_out_parameter,
609
609
  proc { |*_args| 23.4 })
610
610
  end
611
- _(derived_instance.vfunc_one_out_parameter).
612
- must_be_within_epsilon 23.4
611
+ _(derived_instance.vfunc_one_out_parameter)
612
+ .must_be_within_epsilon 23.4
613
613
  end
614
614
 
615
615
  it "has a working method #vfunc_out_enum" do
@@ -632,8 +632,8 @@ describe GIMarshallingTests do
632
632
  :vfunc_return_value_and_multiple_out_parameters,
633
633
  proc { |*_args| [42, -142, 3] })
634
634
  end
635
- _(derived_instance.vfunc_return_value_and_multiple_out_parameters).
636
- must_equal [42, -142, 3]
635
+ _(derived_instance.vfunc_return_value_and_multiple_out_parameters)
636
+ .must_equal [42, -142, 3]
637
637
  end
638
638
 
639
639
  it "has a working method #vfunc_return_value_and_one_out_parameter" do
@@ -642,8 +642,8 @@ describe GIMarshallingTests do
642
642
  :vfunc_return_value_and_one_out_parameter,
643
643
  proc { |*_args| [42, -142] })
644
644
  end
645
- _(derived_instance.vfunc_return_value_and_one_out_parameter).
646
- must_equal [42, -142]
645
+ _(derived_instance.vfunc_return_value_and_one_out_parameter)
646
+ .must_equal [42, -142]
647
647
  end
648
648
 
649
649
  it "has a working method #vfunc_return_value_only" do
@@ -1258,8 +1258,8 @@ describe GIMarshallingTests do
1258
1258
  it "creates an instance using #new" do
1259
1259
  so = GIMarshallingTests::SubObject.new
1260
1260
  _(so).must_be_instance_of GIMarshallingTests::SubObject
1261
- _(GObject.type_name_from_instance(so)).
1262
- must_equal "GIMarshallingTestsSubObject"
1261
+ _(GObject.type_name_from_instance(so))
1262
+ .must_equal "GIMarshallingTestsSubObject"
1263
1263
  end
1264
1264
 
1265
1265
  let(:instance) { GIMarshallingTests::SubObject.new }
@@ -1284,8 +1284,8 @@ describe GIMarshallingTests do
1284
1284
  it "creates an instance using #new" do
1285
1285
  so = GIMarshallingTests::SubSubObject.new
1286
1286
  assert_instance_of GIMarshallingTests::SubSubObject, so
1287
- _(GObject.type_name_from_instance(so)).
1288
- must_equal "GIMarshallingTestsSubSubObject"
1287
+ _(GObject.type_name_from_instance(so))
1288
+ .must_equal "GIMarshallingTestsSubSubObject"
1289
1289
  end
1290
1290
 
1291
1291
  let(:instance) { GIMarshallingTests::SubSubObject.new }
@@ -20,6 +20,10 @@ describe "the generated Gst module" do
20
20
  it "correctly fetches the name" do
21
21
  _(instance.name).must_equal "sink"
22
22
  end
23
+
24
+ it "allows the can-activate-push property to be read" do
25
+ _(instance.get_property("can-activate-push")).must_equal true
26
+ end
23
27
  end
24
28
 
25
29
  describe "Gst::AutoAudioSink" do
@@ -1808,8 +1808,8 @@ describe Regress do
1808
1808
  ret, y, z, q = instance.torture_signature_1(-21, "hello", 12)
1809
1809
  _([ret, y, z, q]).must_equal [true, -21, 2 * -21, "hello".length + 12]
1810
1810
 
1811
- _(proc { instance.torture_signature_1(-21, "hello", 11) }).
1812
- must_raise GirFFI::GLibError
1811
+ _(proc { instance.torture_signature_1(-21, "hello", 11) })
1812
+ .must_raise GirFFI::GLibError
1813
1813
  end
1814
1814
 
1815
1815
  describe "its 'bare' property" do
@@ -2968,8 +2968,8 @@ describe Regress do
2968
2968
  end
2969
2969
 
2970
2970
  it "has a working function #annotation_string_zero_terminated_out" do
2971
- _(Regress.annotation_string_zero_terminated_out(%w(foo bar)).to_a).
2972
- must_equal %w(foo bar)
2971
+ _(Regress.annotation_string_zero_terminated_out(%w(foo bar)).to_a)
2972
+ .must_equal %w(foo bar)
2973
2973
  end
2974
2974
 
2975
2975
  it "has a working function #annotation_test_parsing_bug630862" do
@@ -3920,8 +3920,8 @@ describe Regress do
3920
3920
  ret, y, z, q = Regress.test_torture_signature_1(-21, "hello", 12)
3921
3921
  _([ret, y, z, q]).must_equal [true, -21, 2 * -21, "hello".length + 12]
3922
3922
 
3923
- _(proc { Regress.test_torture_signature_1(-21, "hello", 11) }).
3924
- must_raise GirFFI::GLibError
3923
+ _(proc { Regress.test_torture_signature_1(-21, "hello", 11) })
3924
+ .must_raise GirFFI::GLibError
3925
3925
  end
3926
3926
 
3927
3927
  it "has a working function #test_torture_signature_2" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gir_ffi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matijs van Zuijlen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-19 00:00:00.000000000 Z
11
+ date: 2019-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -450,7 +450,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
450
450
  - !ruby/object:Gem::Version
451
451
  version: '0'
452
452
  requirements: []
453
- rubygems_version: 3.0.3
453
+ rubygems_version: 3.0.6
454
454
  signing_key:
455
455
  specification_version: 4
456
456
  summary: FFI-based GObject binding using the GObject Introspection Repository