gir_ffi 0.7.7 → 0.7.8

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.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +9 -0
  3. data/lib/ffi-glib/array.rb +1 -1
  4. data/lib/ffi-glib/error.rb +1 -2
  5. data/lib/ffi-glib/hash_table.rb +2 -2
  6. data/lib/ffi-glib/variant.rb +1 -1
  7. data/lib/ffi-gobject/base.rb +23 -23
  8. data/lib/ffi-gobject/object.rb +7 -3
  9. data/lib/ffi-gobject/value.rb +6 -1
  10. data/lib/ffi-gobject.rb +9 -6
  11. data/lib/ffi-gobject_introspection/i_base_info.rb +3 -3
  12. data/lib/ffi-gobject_introspection/i_constant_info.rb +1 -1
  13. data/lib/ffi-gobject_introspection/i_repository.rb +4 -1
  14. data/lib/ffi-gobject_introspection/i_type_info.rb +1 -1
  15. data/lib/ffi-gobject_introspection/i_unresolved_info.rb +7 -0
  16. data/lib/ffi-gobject_introspection/lib.rb +1 -1
  17. data/lib/gir_ffi/builders/argument_builder.rb +1 -1
  18. data/lib/gir_ffi/builders/c_to_ruby_convertor.rb +37 -29
  19. data/lib/gir_ffi/builders/callback_argument_builder.rb +57 -27
  20. data/lib/gir_ffi/builders/closure_convertor.rb +12 -8
  21. data/lib/gir_ffi/builders/closure_to_pointer_convertor.rb +12 -8
  22. data/lib/gir_ffi/builders/constructor_result_convertor.rb +11 -7
  23. data/lib/gir_ffi/builders/field_builder.rb +1 -1
  24. data/lib/gir_ffi/builders/function_builder.rb +1 -1
  25. data/lib/gir_ffi/builders/mapping_method_builder.rb +1 -1
  26. data/lib/gir_ffi/builders/marshalling_method_builder.rb +2 -2
  27. data/lib/gir_ffi/builders/method_template.rb +1 -1
  28. data/lib/gir_ffi/builders/null_convertor.rb +11 -7
  29. data/lib/gir_ffi/builders/property_builder.rb +1 -1
  30. data/lib/gir_ffi/builders/ruby_to_c_convertor.rb +17 -13
  31. data/lib/gir_ffi/error_argument_info.rb +1 -1
  32. data/lib/gir_ffi/ffi_ext/pointer.rb +1 -1
  33. data/lib/gir_ffi/info_ext/i_unresolved_info.rb +12 -0
  34. data/lib/gir_ffi/info_ext/safe_constant_name.rb +2 -2
  35. data/lib/gir_ffi/info_ext/safe_function_name.rb +1 -1
  36. data/lib/gir_ffi/info_ext.rb +1 -0
  37. data/lib/gir_ffi/module_base.rb +1 -1
  38. data/lib/gir_ffi/receiver_argument_info.rb +15 -12
  39. data/lib/gir_ffi/user_data_argument_info.rb +17 -15
  40. data/lib/gir_ffi/user_data_type_info.rb +14 -12
  41. data/lib/gir_ffi/version.rb +1 -1
  42. data/lib/gir_ffi-base/gobject/lib.rb +1 -1
  43. data/test/base_test_helper.rb +15 -15
  44. data/test/ffi-glib/array_test.rb +38 -38
  45. data/test/ffi-glib/byte_array_test.rb +6 -7
  46. data/test/ffi-glib/bytes_test.rb +9 -9
  47. data/test/ffi-glib/hash_table_test.rb +26 -23
  48. data/test/ffi-glib/iconv_test.rb +5 -5
  49. data/test/ffi-glib/list_test.rb +16 -16
  50. data/test/ffi-glib/main_loop_test.rb +6 -6
  51. data/test/ffi-glib/ptr_array_test.rb +45 -45
  52. data/test/ffi-glib/ruby_closure_test.rb +6 -6
  53. data/test/ffi-glib/s_list_test.rb +15 -15
  54. data/test/ffi-glib/strv_test.rb +21 -21
  55. data/test/ffi-glib/variant_test.rb +4 -4
  56. data/test/ffi-gobject/gobject_test.rb +35 -35
  57. data/test/ffi-gobject/object_class_test.rb +1 -1
  58. data/test/ffi-gobject/object_test.rb +29 -6
  59. data/test/ffi-gobject/value_test.rb +66 -52
  60. data/test/ffi-gobject_introspection/i_base_info_test.rb +10 -11
  61. data/test/ffi-gobject_introspection/i_constant_info_test.rb +6 -6
  62. data/test/ffi-gobject_introspection/i_enum_info_test.rb +4 -5
  63. data/test/ffi-gobject_introspection/i_function_info_test.rb +0 -2
  64. data/test/ffi-gobject_introspection/i_object_info_test.rb +5 -5
  65. data/test/ffi-gobject_introspection/i_registered_type_info_test.rb +9 -8
  66. data/test/ffi-gobject_introspection/i_repository_test.rb +16 -16
  67. data/test/ffi-gobject_introspection/i_type_info_test.rb +16 -2
  68. data/test/ffi-gobject_introspection/lib_test.rb +2 -2
  69. data/test/ffi-gobject_test.rb +50 -40
  70. data/test/gir_ffi/arg_helper_test.rb +5 -5
  71. data/test/gir_ffi/builder_test.rb +41 -41
  72. data/test/gir_ffi/builders/argument_builder_test.rb +240 -207
  73. data/test/gir_ffi/builders/base_argument_builder_test.rb +0 -1
  74. data/test/gir_ffi/builders/callback_argument_builder_test.rb +81 -15
  75. data/test/gir_ffi/builders/callback_builder_test.rb +39 -14
  76. data/test/gir_ffi/builders/callback_return_value_builder_test.rb +41 -33
  77. data/test/gir_ffi/builders/enum_builder_test.rb +3 -3
  78. data/test/gir_ffi/builders/field_builder_test.rb +17 -17
  79. data/test/gir_ffi/builders/function_builder_test.rb +16 -16
  80. data/test/gir_ffi/builders/interface_builder_test.rb +9 -7
  81. data/test/gir_ffi/builders/module_builder_test.rb +5 -6
  82. data/test/gir_ffi/builders/object_builder_test.rb +24 -19
  83. data/test/gir_ffi/builders/property_builder_test.rb +25 -23
  84. data/test/gir_ffi/builders/registered_type_builder_test.rb +11 -11
  85. data/test/gir_ffi/builders/return_value_builder_test.rb +237 -197
  86. data/test/gir_ffi/builders/signal_closure_builder_test.rb +29 -22
  87. data/test/gir_ffi/builders/struct_builder_test.rb +10 -10
  88. data/test/gir_ffi/builders/unintrospectable_builder_test.rb +8 -8
  89. data/test/gir_ffi/builders/union_builder_test.rb +5 -6
  90. data/test/gir_ffi/builders/user_defined_builder_test.rb +42 -33
  91. data/test/gir_ffi/builders/vfunc_builder_test.rb +37 -30
  92. data/test/gir_ffi/callback_base_test.rb +4 -5
  93. data/test/gir_ffi/class_base_test.rb +35 -28
  94. data/test/gir_ffi/error_type_info_test.rb +14 -14
  95. data/test/gir_ffi/ffi_ext/pointer_test.rb +4 -4
  96. data/test/gir_ffi/g_type_test.rb +6 -6
  97. data/test/gir_ffi/in_out_pointer_test.rb +27 -27
  98. data/test/gir_ffi/in_pointer_test.rb +54 -50
  99. data/test/gir_ffi/info_ext/i_callable_info_test.rb +8 -7
  100. data/test/gir_ffi/info_ext/i_callback_info_test.rb +7 -7
  101. data/test/gir_ffi/info_ext/i_field_info_test.rb +10 -8
  102. data/test/gir_ffi/info_ext/i_function_info_test.rb +17 -15
  103. data/test/gir_ffi/info_ext/i_signal_info_test.rb +10 -8
  104. data/test/gir_ffi/info_ext/i_type_info_test.rb +158 -155
  105. data/test/gir_ffi/info_ext/i_unresolved_info_test.rb +17 -0
  106. data/test/gir_ffi/info_ext/safe_constant_name_test.rb +12 -10
  107. data/test/gir_ffi/info_ext/safe_function_name_test.rb +12 -10
  108. data/test/gir_ffi/interface_base_test.rb +6 -6
  109. data/test/gir_ffi/method_stubber_test.rb +16 -13
  110. data/test/gir_ffi/object_base_test.rb +6 -6
  111. data/test/gir_ffi/sized_array_test.rb +23 -23
  112. data/test/gir_ffi/type_map_test.rb +3 -3
  113. data/test/gir_ffi/unintrospectable_type_info_test.rb +18 -18
  114. data/test/gir_ffi/user_defined_property_info_test.rb +4 -4
  115. data/test/gir_ffi/user_defined_type_info_test.rb +16 -16
  116. data/test/gir_ffi/variable_name_generator_test.rb +6 -6
  117. data/test/gir_ffi/version_test.rb +1 -1
  118. data/test/gir_ffi/zero_terminated_test.rb +16 -17
  119. data/test/gir_ffi-base/glib/boolean_test.rb +13 -13
  120. data/test/gir_ffi-base/glib/strv_test.rb +11 -11
  121. data/test/gir_ffi_test.rb +18 -18
  122. data/test/gir_ffi_test_helper.rb +13 -18
  123. data/test/integration/derived_classes_test.rb +8 -8
  124. data/test/integration/generated_gimarshallingtests_test.rb +794 -792
  125. data/test/integration/generated_gio_test.rb +25 -26
  126. data/test/integration/generated_glib_test.rb +8 -2
  127. data/test/integration/generated_gobject_test.rb +16 -9
  128. data/test/integration/generated_pango_ft2_test.rb +1 -2
  129. data/test/integration/generated_pango_test.rb +2 -2
  130. data/test/integration/generated_regress_test.rb +785 -705
  131. data/test/integration/generated_secret_test.rb +5 -5
  132. data/test/integration/method_lookup_test.rb +5 -5
  133. data/test/introspection_test_helper.rb +3 -1
  134. data/test/minitest/stats_plugin.rb +3 -3
  135. metadata +6 -3
@@ -1,9 +1,11 @@
1
1
  require 'gir_ffi_test_helper'
2
2
 
3
3
  describe GirFFI::InfoExt::ITypeInfo do
4
- let(:klass) { Class.new do
5
- include GirFFI::InfoExt::ITypeInfo
6
- end }
4
+ let(:klass) {
5
+ Class.new do
6
+ include GirFFI::InfoExt::ITypeInfo
7
+ end
8
+ }
7
9
 
8
10
  let(:type_info) { klass.new }
9
11
  let(:elmtype_info) { klass.new }
@@ -12,13 +14,15 @@ describe GirFFI::InfoExt::ITypeInfo do
12
14
  let(:iface_info) { Object.new }
13
15
 
14
16
  let(:callback_type_info) {
15
- get_introspection_data('Regress', 'test_callback').args[0].argument_type }
17
+ get_introspection_data('Regress', 'test_callback').args[0].argument_type
18
+ }
16
19
  let(:ghash_type_info) {
17
20
  get_introspection_data('Regress',
18
- 'test_ghash_nested_everything_return').return_type }
21
+ 'test_ghash_nested_everything_return').return_type
22
+ }
19
23
 
20
- describe "#to_ffitype" do
21
- it "returns an array with elements subtype and size for type :array" do
24
+ describe '#to_ffitype' do
25
+ it 'returns an array with elements subtype and size for type :array' do
22
26
  mock(type_info).pointer? { false }
23
27
  stub(type_info).tag { :array }
24
28
  mock(type_info).array_fixed_size { 2 }
@@ -30,7 +34,7 @@ describe GirFFI::InfoExt::ITypeInfo do
30
34
  assert_equal [:foo, 2], result
31
35
  end
32
36
 
33
- describe "for an :interface type" do
37
+ describe 'for an :interface type' do
34
38
  before do
35
39
  stub(type_info).interface { iface_info }
36
40
  stub(type_info).tag { :interface }
@@ -45,25 +49,25 @@ describe GirFFI::InfoExt::ITypeInfo do
45
49
  end
46
50
  end
47
51
 
48
- describe "#element_type" do
49
- it "returns the element type for lists" do
52
+ describe '#element_type' do
53
+ it 'returns the element type for lists' do
50
54
  stub(elmtype_info).tag { :foo }
51
55
  mock(elmtype_info).pointer? { false }
52
56
 
53
- mock(type_info).tag {:glist}
57
+ mock(type_info).tag { :glist }
54
58
  mock(type_info).param_type(0) { elmtype_info }
55
59
 
56
60
  result = type_info.element_type
57
61
  result.must_equal :foo
58
62
  end
59
63
 
60
- it "returns the key and value types for ghashes" do
64
+ it 'returns the key and value types for ghashes' do
61
65
  stub(keytype_info).tag { :foo }
62
66
  mock(keytype_info).pointer? { false }
63
67
  stub(valtype_info).tag { :bar }
64
68
  mock(valtype_info).pointer? { false }
65
69
 
66
- mock(type_info).tag {:ghash}
70
+ mock(type_info).tag { :ghash }
67
71
  mock(type_info).param_type(0) { keytype_info }
68
72
  mock(type_info).param_type(1) { valtype_info }
69
73
 
@@ -71,41 +75,41 @@ describe GirFFI::InfoExt::ITypeInfo do
71
75
  result.must_equal [:foo, :bar]
72
76
  end
73
77
 
74
- it "returns nil for other types" do
75
- mock(type_info).tag {:foo}
78
+ it 'returns nil for other types' do
79
+ mock(type_info).tag { :foo }
76
80
 
77
81
  result = type_info.element_type
78
82
  result.must_be_nil
79
83
  end
80
84
 
81
- it "returns [:pointer, :void] if the element type is a pointer with tag :void" do
85
+ it 'returns [:pointer, :void] if the element type is a pointer with tag :void' do
82
86
  stub(elmtype_info).tag_or_class { [:pointer, :void] }
83
87
 
84
- mock(type_info).tag {:glist}
88
+ mock(type_info).tag { :glist }
85
89
  mock(type_info).param_type(0) { elmtype_info }
86
90
 
87
91
  assert_equal [:pointer, :void], type_info.element_type
88
92
  end
89
93
  end
90
94
 
91
- describe "#flattened_tag" do
92
- describe "for a simple type" do
93
- it "returns the type tag" do
95
+ describe '#flattened_tag' do
96
+ describe 'for a simple type' do
97
+ it 'returns the type tag' do
94
98
  stub(type_info).tag { :uint32 }
95
99
 
96
100
  type_info.flattened_tag.must_equal :uint32
97
101
  end
98
102
  end
99
103
 
100
- describe "for a zero-terminated array" do
104
+ describe 'for a zero-terminated array' do
101
105
  before do
102
106
  stub(type_info).tag { :array }
103
107
  stub(type_info).param_type(0) { elmtype_info }
104
108
  stub(type_info).zero_terminated? { true }
105
109
  end
106
110
 
107
- describe "of utf8" do
108
- it "returns :strv" do
111
+ describe 'of utf8' do
112
+ it 'returns :strv' do
109
113
  stub(elmtype_info).tag { :utf8 }
110
114
  stub(elmtype_info).pointer? { true }
111
115
 
@@ -113,8 +117,8 @@ describe GirFFI::InfoExt::ITypeInfo do
113
117
  end
114
118
  end
115
119
 
116
- describe "of filename" do
117
- it "returns :strv" do
120
+ describe 'of filename' do
121
+ it 'returns :strv' do
118
122
  stub(elmtype_info).tag { :filename }
119
123
  stub(elmtype_info).pointer? { true }
120
124
 
@@ -122,8 +126,8 @@ describe GirFFI::InfoExt::ITypeInfo do
122
126
  end
123
127
  end
124
128
 
125
- describe "of another type" do
126
- it "returns :zero_terminated" do
129
+ describe 'of another type' do
130
+ it 'returns :zero_terminated' do
127
131
  stub(elmtype_info).tag { :foo }
128
132
  stub(elmtype_info).pointer? { false }
129
133
 
@@ -132,8 +136,8 @@ describe GirFFI::InfoExt::ITypeInfo do
132
136
  end
133
137
  end
134
138
 
135
- describe "for a fixed length c-like array" do
136
- it "returns :c" do
139
+ describe 'for a fixed length c-like array' do
140
+ it 'returns :c' do
137
141
  mock(type_info).tag { :array }
138
142
  mock(type_info).zero_terminated? { false }
139
143
  mock(type_info).array_type { :c }
@@ -142,8 +146,8 @@ describe GirFFI::InfoExt::ITypeInfo do
142
146
  end
143
147
  end
144
148
 
145
- describe "for a GLib array" do
146
- it "returns :c" do
149
+ describe 'for a GLib array' do
150
+ it 'returns :c' do
147
151
  mock(type_info).tag { :array }
148
152
  mock(type_info).zero_terminated? { false }
149
153
  mock(type_info).array_type { :array }
@@ -153,8 +157,8 @@ describe GirFFI::InfoExt::ITypeInfo do
153
157
  end
154
158
  end
155
159
 
156
- describe "#tag_or_class" do
157
- describe "for a simple type" do
160
+ describe '#tag_or_class' do
161
+ describe 'for a simple type' do
158
162
  it "returns the type's tag" do
159
163
  stub(type_info).tag { :foo }
160
164
  mock(type_info).pointer? { false }
@@ -163,8 +167,8 @@ describe GirFFI::InfoExt::ITypeInfo do
163
167
  end
164
168
  end
165
169
 
166
- describe "for utf8 strings" do
167
- it "returns the tag :utf8" do
170
+ describe 'for utf8 strings' do
171
+ it 'returns the tag :utf8' do
168
172
  stub(type_info).tag { :utf8 }
169
173
  mock(type_info).pointer? { true }
170
174
 
@@ -172,8 +176,8 @@ describe GirFFI::InfoExt::ITypeInfo do
172
176
  end
173
177
  end
174
178
 
175
- describe "for filename strings" do
176
- it "returns the tag :filename" do
179
+ describe 'for filename strings' do
180
+ it 'returns the tag :filename' do
177
181
  stub(type_info).tag { :filename }
178
182
  mock(type_info).pointer? { true }
179
183
 
@@ -181,7 +185,7 @@ describe GirFFI::InfoExt::ITypeInfo do
181
185
  end
182
186
  end
183
187
 
184
- describe "for an interface class" do
188
+ describe 'for an interface class' do
185
189
  let(:interface) { Object.new }
186
190
 
187
191
  before do
@@ -192,24 +196,24 @@ describe GirFFI::InfoExt::ITypeInfo do
192
196
  mock(GirFFI::Builder).build_class(iface_info) { interface }
193
197
  end
194
198
 
195
- describe "when the interface type is :enum" do
196
- it "returns the built interface module" do
199
+ describe 'when the interface type is :enum' do
200
+ it 'returns the built interface module' do
197
201
  stub(iface_info).info_type { :enum }
198
202
 
199
203
  type_info.tag_or_class.must_equal interface
200
204
  end
201
205
  end
202
206
 
203
- describe "when the interface type is :object" do
204
- it "returns the built interface class" do
207
+ describe 'when the interface type is :object' do
208
+ it 'returns the built interface class' do
205
209
  stub(iface_info).info_type { :object }
206
210
 
207
211
  type_info.tag_or_class.must_equal interface
208
212
  end
209
213
  end
210
214
 
211
- describe "when the interface type is :struct" do
212
- it "returns the built interface class" do
215
+ describe 'when the interface type is :struct' do
216
+ it 'returns the built interface class' do
213
217
  stub(iface_info).info_type { :struct }
214
218
 
215
219
  type_info.tag_or_class.must_equal interface
@@ -218,14 +222,14 @@ describe GirFFI::InfoExt::ITypeInfo do
218
222
 
219
223
  end
220
224
 
221
- describe "for a callback" do
225
+ describe 'for a callback' do
222
226
  it "returns the callback's wrapper class" do
223
227
  callback_type_info.tag_or_class.must_equal Regress::TestCallback
224
228
  end
225
229
  end
226
230
 
227
- describe "for a pointer to simple type :foo" do
228
- it "returns [:pointer, :foo]" do
231
+ describe 'for a pointer to simple type :foo' do
232
+ it 'returns [:pointer, :foo]' do
229
233
  stub(type_info).tag { :foo }
230
234
  mock(type_info).pointer? { true }
231
235
 
@@ -233,8 +237,8 @@ describe GirFFI::InfoExt::ITypeInfo do
233
237
  end
234
238
  end
235
239
 
236
- describe "for a pointer to :void" do
237
- it "returns [:pointer, :void]" do
240
+ describe 'for a pointer to :void' do
241
+ it 'returns [:pointer, :void]' do
238
242
  stub(type_info).tag { :void }
239
243
  stub(type_info).pointer? { true }
240
244
 
@@ -242,33 +246,33 @@ describe GirFFI::InfoExt::ITypeInfo do
242
246
  end
243
247
  end
244
248
 
245
- describe "for a complex nested hash type" do
246
- it "returns a representeation of the nested structure" do
249
+ describe 'for a complex nested hash type' do
250
+ it 'returns a representeation of the nested structure' do
247
251
  ghash_type_info.tag_or_class.must_equal(
248
- [ :pointer,
249
- [ :ghash,
250
- :utf8,
251
- [ :pointer,
252
- [ :ghash, :utf8, :utf8 ] ] ] ])
252
+ [:pointer,
253
+ [:ghash,
254
+ :utf8,
255
+ [:pointer,
256
+ [:ghash, :utf8, :utf8]]]])
253
257
  end
254
258
  end
255
259
  end
256
260
 
257
- describe "#to_callback_ffitype" do
258
- describe "for an :interface argument" do
261
+ describe '#to_callback_ffitype' do
262
+ describe 'for an :interface argument' do
259
263
  before do
260
264
  stub(type_info).interface { iface_info }
261
265
  stub(type_info).tag { :interface }
262
266
  stub(type_info).pointer? { false }
263
267
  end
264
268
 
265
- it "correctly maps a :union argument to :pointer" do
269
+ it 'correctly maps a :union argument to :pointer' do
266
270
  stub(iface_info).info_type { :union }
267
271
 
268
272
  type_info.to_callback_ffitype.must_equal :pointer
269
273
  end
270
274
 
271
- it "correctly maps a :flags argument to :int32" do
275
+ it 'correctly maps a :flags argument to :int32' do
272
276
  stub(iface_info).info_type { :flags }
273
277
 
274
278
  type_info.to_callback_ffitype.must_equal :int32
@@ -276,28 +280,28 @@ describe GirFFI::InfoExt::ITypeInfo do
276
280
  end
277
281
  end
278
282
 
279
- describe "#extra_conversion_arguments" do
280
- describe "for normal types" do
283
+ describe '#extra_conversion_arguments' do
284
+ describe 'for normal types' do
281
285
  before do
282
286
  stub(type_info).tag { :foo }
283
287
  end
284
288
 
285
- it "returns an empty array" do
289
+ it 'returns an empty array' do
286
290
  type_info.extra_conversion_arguments.must_equal []
287
291
  end
288
292
  end
289
293
 
290
- describe "for a string" do
294
+ describe 'for a string' do
291
295
  before do
292
296
  stub(type_info).tag { :utf8 }
293
297
  end
294
298
 
295
- it "returns an array containing :utf8" do
299
+ it 'returns an array containing :utf8' do
296
300
  type_info.extra_conversion_arguments.must_equal [:utf8]
297
301
  end
298
302
  end
299
303
 
300
- describe "for a fixed-size array" do
304
+ describe 'for a fixed-size array' do
301
305
  before do
302
306
  stub(type_info).tag { :array }
303
307
  stub(type_info).zero_terminated? { false }
@@ -308,12 +312,12 @@ describe GirFFI::InfoExt::ITypeInfo do
308
312
  stub(elmtype_info).tag_or_class { :foo }
309
313
  end
310
314
 
311
- it "returns an array containing the element type" do
315
+ it 'returns an array containing the element type' do
312
316
  type_info.extra_conversion_arguments.must_equal [:foo, 3]
313
317
  end
314
318
  end
315
319
 
316
- describe "for a zero-terminated array" do
320
+ describe 'for a zero-terminated array' do
317
321
  before do
318
322
  stub(type_info).tag { :array }
319
323
  stub(type_info).zero_terminated? { true }
@@ -322,12 +326,12 @@ describe GirFFI::InfoExt::ITypeInfo do
322
326
  stub(elmtype_info).tag_or_class { :foo }
323
327
  end
324
328
 
325
- it "returns an array containing the element type" do
329
+ it 'returns an array containing the element type' do
326
330
  type_info.extra_conversion_arguments.must_equal [:foo]
327
331
  end
328
332
  end
329
333
 
330
- describe "for a GArray" do
334
+ describe 'for a GArray' do
331
335
  before do
332
336
  stub(type_info).tag { :array }
333
337
  stub(type_info).zero_terminated? { false }
@@ -337,14 +341,14 @@ describe GirFFI::InfoExt::ITypeInfo do
337
341
  stub(elmtype_info).tag_or_class { :foo }
338
342
  end
339
343
 
340
- it "returns an array containing the element type" do
344
+ it 'returns an array containing the element type' do
341
345
  type_info.extra_conversion_arguments.must_equal [:foo]
342
346
  end
343
347
  end
344
348
 
345
- describe "for a GHashTable" do
349
+ describe 'for a GHashTable' do
346
350
  before do
347
- stub(type_info).tag {:ghash}
351
+ stub(type_info).tag { :ghash }
348
352
  stub(type_info).param_type(0) { keytype_info }
349
353
  stub(type_info).param_type(1) { valtype_info }
350
354
 
@@ -352,12 +356,12 @@ describe GirFFI::InfoExt::ITypeInfo do
352
356
  stub(valtype_info).tag_or_class { :bar }
353
357
  end
354
358
 
355
- it "returns an array containing the element type pair" do
359
+ it 'returns an array containing the element type pair' do
356
360
  type_info.extra_conversion_arguments.must_equal [[:foo, :bar]]
357
361
  end
358
362
  end
359
363
 
360
- describe "for a GList" do
364
+ describe 'for a GList' do
361
365
  before do
362
366
  stub(type_info).tag { :glist }
363
367
 
@@ -365,12 +369,12 @@ describe GirFFI::InfoExt::ITypeInfo do
365
369
  stub(elmtype_info).tag_or_class { :foo }
366
370
  end
367
371
 
368
- it "returns an array containing the element type" do
372
+ it 'returns an array containing the element type' do
369
373
  type_info.extra_conversion_arguments.must_equal [:foo]
370
374
  end
371
375
  end
372
376
 
373
- describe "for a GSList" do
377
+ describe 'for a GSList' do
374
378
  before do
375
379
  stub(type_info).tag { :gslist }
376
380
 
@@ -378,56 +382,55 @@ describe GirFFI::InfoExt::ITypeInfo do
378
382
  stub(elmtype_info).tag_or_class { :foo }
379
383
  end
380
384
 
381
- it "returns an array containing the element type" do
385
+ it 'returns an array containing the element type' do
382
386
  type_info.extra_conversion_arguments.must_equal [:foo]
383
387
  end
384
388
  end
385
389
 
386
- describe "for a GPtrArray" do
390
+ describe 'for a GPtrArray' do
387
391
  before do
388
392
  stub(type_info).tag { :array }
389
393
  stub(type_info).zero_terminated? { false }
390
394
  stub(type_info).array_type { :ptr_array }
391
395
 
392
-
393
396
  stub(type_info).param_type(0) { elmtype_info }
394
397
  stub(elmtype_info).tag_or_class { :foo }
395
398
  end
396
399
 
397
- it "returns an array containing the element type" do
400
+ it 'returns an array containing the element type' do
398
401
  type_info.extra_conversion_arguments.must_equal [:foo]
399
402
  end
400
403
  end
401
404
 
402
- describe "for a :callback" do
405
+ describe 'for a :callback' do
403
406
  before do
404
- stub(interface_type_info = Object.new).namespace { "Bar" }
405
- stub(interface_type_info).name { "Foo" }
407
+ stub(interface_type_info = Object.new).namespace { 'Bar' }
408
+ stub(interface_type_info).name { 'Foo' }
406
409
 
407
410
  stub(type_info).tag { :callback }
408
411
  stub(type_info).interface { interface_type_info }
409
412
  end
410
413
 
411
- it "returns an empty array" do
414
+ it 'returns an empty array' do
412
415
  type_info.extra_conversion_arguments.must_equal []
413
416
  end
414
417
  end
415
418
  end
416
419
 
417
- describe "#argument_class_name" do
420
+ describe '#argument_class_name' do
418
421
  before do
419
422
  stub(type_info).tag { tag }
420
423
  end
421
424
 
422
- describe "for :gint32" do
425
+ describe 'for :gint32' do
423
426
  let(:tag) { :gint32 }
424
427
 
425
- it "is nil" do
428
+ it 'is nil' do
426
429
  type_info.argument_class_name.must_be_nil
427
430
  end
428
431
  end
429
432
 
430
- describe "for interfaces" do
433
+ describe 'for interfaces' do
431
434
  let(:tag) { :interface }
432
435
 
433
436
  before do
@@ -436,253 +439,253 @@ describe GirFFI::InfoExt::ITypeInfo do
436
439
  stub(iface_info).full_type_name { 'Bar::Foo' }
437
440
  end
438
441
 
439
- describe "for :struct" do
442
+ describe 'for :struct' do
440
443
  let(:interface_type) { :struct }
441
- it "equals the struct class name" do
444
+ it 'equals the struct class name' do
442
445
  type_info.argument_class_name.must_equal 'Bar::Foo'
443
446
  end
444
447
  end
445
448
 
446
- describe "for :union" do
449
+ describe 'for :union' do
447
450
  let(:interface_type) { :union }
448
- it "equals the union class name" do
451
+ it 'equals the union class name' do
449
452
  type_info.argument_class_name.must_equal 'Bar::Foo'
450
453
  end
451
454
  end
452
455
 
453
- describe "for :interface" do
456
+ describe 'for :interface' do
454
457
  let(:interface_type) { :interface }
455
458
 
456
- it "equals the interface module name" do
459
+ it 'equals the interface module name' do
457
460
  type_info.argument_class_name.must_equal 'Bar::Foo'
458
461
  end
459
462
  end
460
463
 
461
- describe "for :object" do
464
+ describe 'for :object' do
462
465
  let(:interface_type) { :object }
463
466
 
464
- it "equals the object class name" do
467
+ it 'equals the object class name' do
465
468
  type_info.argument_class_name.must_equal 'Bar::Foo'
466
469
  end
467
470
  end
468
471
 
469
- describe "for :callback" do
472
+ describe 'for :callback' do
470
473
  let(:interface_type) { :callback }
471
474
 
472
- it "equals the callback type name" do
475
+ it 'equals the callback type name' do
473
476
  type_info.argument_class_name.must_equal 'Bar::Foo'
474
477
  end
475
478
  end
476
479
  end
477
480
 
478
- describe "for :strv" do
481
+ describe 'for :strv' do
479
482
  let(:tag) { :strv }
480
483
 
481
- it "equals GLib::Strv" do
484
+ it 'equals GLib::Strv' do
482
485
  type_info.argument_class_name.must_equal 'GLib::Strv'
483
486
  end
484
487
  end
485
488
 
486
- describe "for arrays" do
489
+ describe 'for arrays' do
487
490
  let(:tag) { :array }
488
491
  before do
489
492
  stub(type_info).param_type(0) { elmtype_info }
490
493
  stub(elmtype_info).tag_or_class { :foo }
491
494
  end
492
495
 
493
- describe "for :zero_terminated" do
496
+ describe 'for :zero_terminated' do
494
497
  before do
495
498
  stub(type_info).zero_terminated? { true }
496
499
  end
497
500
 
498
- it "equals GirFFI::ZeroTerminated" do
499
- type_info.argument_class_name.must_equal "GirFFI::ZeroTerminated"
501
+ it 'equals GirFFI::ZeroTerminated' do
502
+ type_info.argument_class_name.must_equal 'GirFFI::ZeroTerminated'
500
503
  end
501
504
  end
502
505
 
503
- describe "for :byte_array" do
506
+ describe 'for :byte_array' do
504
507
  before do
505
508
  stub(type_info).zero_terminated? { false }
506
509
  stub(type_info).array_type { :byte_array }
507
510
  end
508
511
 
509
- it "equals GLib::ByteArray" do
512
+ it 'equals GLib::ByteArray' do
510
513
  type_info.argument_class_name.must_equal 'GLib::ByteArray'
511
514
  end
512
515
  end
513
516
 
514
- describe "for :ptr_array" do
517
+ describe 'for :ptr_array' do
515
518
  before do
516
519
  stub(type_info).zero_terminated? { false }
517
520
  stub(type_info).array_type { :ptr_array }
518
521
  end
519
522
 
520
- it "equals GLib::PtrArray" do
523
+ it 'equals GLib::PtrArray' do
521
524
  type_info.argument_class_name.must_equal 'GLib::PtrArray'
522
525
  end
523
526
  end
524
527
 
525
- describe "for :array" do
528
+ describe 'for :array' do
526
529
  before do
527
530
  stub(type_info).zero_terminated? { false }
528
531
  stub(type_info).array_type { :array }
529
532
  end
530
533
 
531
- it "equals GLib::Array" do
534
+ it 'equals GLib::Array' do
532
535
  type_info.argument_class_name.must_equal 'GLib::Array'
533
536
  end
534
537
  end
535
538
  end
536
539
 
537
- describe "for :glist" do
540
+ describe 'for :glist' do
538
541
  let(:tag) { :glist }
539
542
 
540
- it "equals GLib::List" do
543
+ it 'equals GLib::List' do
541
544
  type_info.argument_class_name.must_equal 'GLib::List'
542
545
  end
543
546
  end
544
547
 
545
- describe "for :gslist" do
548
+ describe 'for :gslist' do
546
549
  let(:tag) { :gslist }
547
550
 
548
- it "equals GLib::SList" do
551
+ it 'equals GLib::SList' do
549
552
  type_info.argument_class_name.must_equal 'GLib::SList'
550
553
  end
551
554
  end
552
555
 
553
- describe "for :ghash" do
556
+ describe 'for :ghash' do
554
557
  let(:tag) { :ghash }
555
558
 
556
- it "equals GLib::HashTable" do
559
+ it 'equals GLib::HashTable' do
557
560
  type_info.argument_class_name.must_equal 'GLib::HashTable'
558
561
  end
559
562
  end
560
563
 
561
- describe "for :error" do
564
+ describe 'for :error' do
562
565
  let(:tag) { :error }
563
566
 
564
- it "equals GLib::Error" do
567
+ it 'equals GLib::Error' do
565
568
  type_info.argument_class_name.must_equal 'GLib::Error'
566
569
  end
567
570
  end
568
571
  end
569
572
 
570
- describe "#g_type" do
573
+ describe '#g_type' do
571
574
  before do
572
575
  stub(type_info).tag { tag }
573
576
  stub(type_info).pointer? { pointer? }
574
577
  end
575
578
 
576
- describe "for :void" do
579
+ describe 'for :void' do
577
580
  let(:tag) { :void }
578
581
  let(:pointer?) { false }
579
582
 
580
- it "equals the none type" do
581
- GObject.type_name(type_info.g_type).must_equal "void"
583
+ it 'equals the none type' do
584
+ GObject.type_name(type_info.g_type).must_equal 'void'
582
585
  end
583
586
  end
584
587
 
585
- describe "for :gboolean" do
588
+ describe 'for :gboolean' do
586
589
  let(:tag) { :gboolean }
587
590
  let(:pointer?) { false }
588
591
 
589
- it "equals the gboolean type" do
590
- GObject.type_name(type_info.g_type).must_equal "gboolean"
592
+ it 'equals the gboolean type' do
593
+ GObject.type_name(type_info.g_type).must_equal 'gboolean'
591
594
  end
592
595
  end
593
596
 
594
- describe "for :gint32" do
597
+ describe 'for :gint32' do
595
598
  let(:tag) { :gint32 }
596
599
  let(:pointer?) { false }
597
600
 
598
- it "equals the gint type" do
599
- GObject.type_name(type_info.g_type).must_equal "gint"
601
+ it 'equals the gint type' do
602
+ GObject.type_name(type_info.g_type).must_equal 'gint'
600
603
  end
601
604
  end
602
605
 
603
- describe "for :gint64" do
606
+ describe 'for :gint64' do
604
607
  let(:tag) { :gint64 }
605
608
  let(:pointer?) { false }
606
609
 
607
- it "equals the gint64 type" do
608
- GObject.type_name(type_info.g_type).must_equal "gint64"
610
+ it 'equals the gint64 type' do
611
+ GObject.type_name(type_info.g_type).must_equal 'gint64'
609
612
  end
610
613
  end
611
614
 
612
- describe "for :guint64" do
615
+ describe 'for :guint64' do
613
616
  let(:tag) { :guint64 }
614
617
  let(:pointer?) { false }
615
618
 
616
- it "equals the guint64 type" do
617
- GObject.type_name(type_info.g_type).must_equal "guint64"
619
+ it 'equals the guint64 type' do
620
+ GObject.type_name(type_info.g_type).must_equal 'guint64'
618
621
  end
619
622
  end
620
623
 
621
- describe "for pointer to :utf8" do
624
+ describe 'for pointer to :utf8' do
622
625
  let(:tag) { :utf8 }
623
626
  let(:pointer?) { true }
624
627
 
625
- it "equals the gchararray type" do
626
- GObject.type_name(type_info.g_type).must_equal "gchararray"
628
+ it 'equals the gchararray type' do
629
+ GObject.type_name(type_info.g_type).must_equal 'gchararray'
627
630
  end
628
631
  end
629
632
 
630
- describe "for pointer to :ghash" do
633
+ describe 'for pointer to :ghash' do
631
634
  let(:tag) { :ghash }
632
635
  let(:pointer?) { true }
633
636
 
634
- it "equals the GHashTable type" do
635
- GObject.type_name(type_info.g_type).must_equal "GHashTable"
637
+ it 'equals the GHashTable type' do
638
+ GObject.type_name(type_info.g_type).must_equal 'GHashTable'
636
639
  end
637
640
  end
638
641
 
639
- describe "for arrays" do
642
+ describe 'for arrays' do
640
643
  let(:tag) { :array }
641
644
  let(:pointer?) { true }
642
645
 
643
- describe "for pointer to GArray" do
646
+ describe 'for pointer to GArray' do
644
647
  before do
645
648
  stub(type_info).zero_terminated? { false }
646
649
  stub(type_info).array_type { :array }
647
650
  end
648
651
 
649
- it "equals the GArray type" do
650
- GObject.type_name(type_info.g_type).must_equal "GArray"
652
+ it 'equals the GArray type' do
653
+ GObject.type_name(type_info.g_type).must_equal 'GArray'
651
654
  end
652
655
  end
653
656
 
654
- describe "for a C array" do
657
+ describe 'for a C array' do
655
658
  before do
656
659
  stub(type_info).zero_terminated? { false }
657
660
  stub(type_info).array_type { :c }
658
661
  end
659
662
 
660
- it "equals the gpointer type" do
661
- GObject.type_name(type_info.g_type).must_equal "gpointer"
663
+ it 'equals the gpointer type' do
664
+ GObject.type_name(type_info.g_type).must_equal 'gpointer'
662
665
  end
663
666
  end
664
667
 
665
- describe "for a zero-terminated array" do
668
+ describe 'for a zero-terminated array' do
666
669
  before do
667
670
  stub(type_info).param_type(0) { elmtype_info }
668
671
  stub(type_info).zero_terminated? { true }
669
672
  end
670
673
 
671
- describe "of utf8" do
672
- it "equals the GStrv type" do
674
+ describe 'of utf8' do
675
+ it 'equals the GStrv type' do
673
676
  stub(elmtype_info).tag { :utf8 }
674
677
  stub(elmtype_info).pointer? { true }
675
678
 
676
- GObject.type_name(type_info.g_type).must_equal "GStrv"
679
+ GObject.type_name(type_info.g_type).must_equal 'GStrv'
677
680
  end
678
681
  end
679
682
 
680
- describe "of filename" do
681
- it "equals the GStrv type" do
683
+ describe 'of filename' do
684
+ it 'equals the GStrv type' do
682
685
  stub(elmtype_info).tag { :filename }
683
686
  stub(elmtype_info).pointer? { true }
684
687
 
685
- GObject.type_name(type_info.g_type).must_equal "GStrv"
688
+ GObject.type_name(type_info.g_type).must_equal 'GStrv'
686
689
  end
687
690
  end
688
691
  end