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,21 +1,21 @@
1
1
  require 'gir_ffi_test_helper'
2
2
 
3
3
  describe GirFFI::ZeroTerminated do
4
- describe ".from" do
4
+ describe '.from' do
5
5
  let(:result) { GirFFI::ZeroTerminated.from :int32, [1, 2, 3] }
6
6
 
7
- it "converts the passed array into a zero-terminated c array" do
7
+ it 'converts the passed array into a zero-terminated c array' do
8
8
  ptr = result.to_ptr
9
9
  ptr.read_array_of_int32(4).must_equal [1, 2, 3, 0]
10
10
  end
11
11
 
12
- it "returns a GirFFI::ZeroTerminated object" do
12
+ it 'returns a GirFFI::ZeroTerminated object' do
13
13
  result.must_be_instance_of GirFFI::ZeroTerminated
14
14
  end
15
15
  end
16
16
 
17
- describe ".wrap" do
18
- it "wraps the given type and pointer" do
17
+ describe '.wrap' do
18
+ it 'wraps the given type and pointer' do
19
19
  ptr = GirFFI::InPointer.from_array :int32, [1, 2, 3, 0]
20
20
  zt = GirFFI::ZeroTerminated.wrap :foo, ptr
21
21
  zt.element_type.must_equal :foo
@@ -23,8 +23,8 @@ describe GirFFI::ZeroTerminated do
23
23
  end
24
24
  end
25
25
 
26
- describe "#each" do
27
- it "yields each element" do
26
+ describe '#each' do
27
+ it 'yields each element' do
28
28
  zt = GirFFI::ZeroTerminated.from :int32, [1, 2, 3]
29
29
  arr = []
30
30
  zt.each do |int|
@@ -33,14 +33,14 @@ describe GirFFI::ZeroTerminated do
33
33
  arr.must_equal [1, 2, 3]
34
34
  end
35
35
 
36
- it "yields zero times for a ZeroTerminated wrapping a null pointer" do
36
+ it 'yields zero times for a ZeroTerminated wrapping a null pointer' do
37
37
  zt = GirFFI::ZeroTerminated.wrap :int32, FFI::Pointer.new(0)
38
- zt.each do |str|
38
+ zt.each do |_str|
39
39
  flunk
40
40
  end
41
41
  end
42
42
 
43
- it "works for :int8" do
43
+ it 'works for :int8' do
44
44
  zt = GirFFI::ZeroTerminated.from :int8, [1, 2, 3]
45
45
  arr = []
46
46
  zt.each do |int|
@@ -51,27 +51,27 @@ describe GirFFI::ZeroTerminated do
51
51
 
52
52
  end
53
53
 
54
- describe "#==" do
55
- it "returns true when comparing to an array with the same elements" do
54
+ describe '#==' do
55
+ it 'returns true when comparing to an array with the same elements' do
56
56
  zero_terminated = GirFFI::ZeroTerminated.from :int32, [1, 2, 3]
57
57
 
58
58
  (zero_terminated == [1, 2, 3]).must_equal true
59
59
  end
60
60
 
61
- it "returns false when comparing to an array with different elements" do
61
+ it 'returns false when comparing to an array with different elements' do
62
62
  zero_terminated = GirFFI::ZeroTerminated.from :int32, [1, 2, 3]
63
63
 
64
64
  (zero_terminated == [1, 2]).must_equal false
65
65
  end
66
66
 
67
- it "returns true when comparing to a zero-terminated array with the same elements" do
67
+ it 'returns true when comparing to a zero-terminated array with the same elements' do
68
68
  zero_terminated = GirFFI::ZeroTerminated.from :int32, [1, 2, 3]
69
69
  other = GirFFI::ZeroTerminated.from :int32, [1, 2, 3]
70
70
 
71
71
  (zero_terminated == other).must_equal true
72
72
  end
73
73
 
74
- it "returns false when comparing to a zero-terminated array with different elements" do
74
+ it 'returns false when comparing to a zero-terminated array with different elements' do
75
75
  zero_terminated = GirFFI::ZeroTerminated.from :int32, [1, 2, 3]
76
76
  other = GirFFI::ZeroTerminated.from :int32, [1, 2]
77
77
 
@@ -79,8 +79,7 @@ describe GirFFI::ZeroTerminated do
79
79
  end
80
80
  end
81
81
 
82
- it "includes Enumerable" do
82
+ it 'includes Enumerable' do
83
83
  GirFFI::ZeroTerminated.must_include Enumerable
84
84
  end
85
85
  end
86
-
@@ -1,32 +1,32 @@
1
1
  require 'gir_ffi_test_helper'
2
2
 
3
3
  describe GLib::Boolean do
4
- it "has the same native size as an int" do
4
+ it 'has the same native size as an int' do
5
5
  FFI.type_size(GLib::Boolean).must_equal FFI.type_size :int
6
6
  end
7
7
 
8
- describe ".from_native" do
9
- it "converts 0 to false" do
10
- GLib::Boolean.from_native(0, "whatever").must_equal false
8
+ describe '.from_native' do
9
+ it 'converts 0 to false' do
10
+ GLib::Boolean.from_native(0, 'whatever').must_equal false
11
11
  end
12
12
 
13
- it "converts 1 to true" do
14
- GLib::Boolean.from_native(1, "whatever").must_equal true
13
+ it 'converts 1 to true' do
14
+ GLib::Boolean.from_native(1, 'whatever').must_equal true
15
15
  end
16
16
  end
17
17
 
18
- describe ".to_native" do
19
- it "converts false to 0" do
20
- GLib::Boolean.to_native(false, "whatever").must_equal 0
18
+ describe '.to_native' do
19
+ it 'converts false to 0' do
20
+ GLib::Boolean.to_native(false, 'whatever').must_equal 0
21
21
  end
22
22
 
23
- it "converts true to 1" do
24
- GLib::Boolean.to_native(true, "whatever").must_equal 1
23
+ it 'converts true to 1' do
24
+ GLib::Boolean.to_native(true, 'whatever').must_equal 1
25
25
  end
26
26
  end
27
27
 
28
- describe ".size" do
29
- it "returns the correct type size" do
28
+ describe '.size' do
29
+ it 'returns the correct type size' do
30
30
  GLib::Boolean.size.must_equal FFI.type_size :int
31
31
  end
32
32
  end
@@ -1,23 +1,23 @@
1
1
  require 'base_test_helper'
2
2
 
3
3
  describe GLib::Strv do
4
- it "wraps a pointer" do
4
+ it 'wraps a pointer' do
5
5
  strv = GLib::Strv.new :some_pointer
6
6
  assert_equal :some_pointer, strv.to_ptr
7
7
  end
8
8
 
9
- describe "::wrap" do
10
- it "takes a pointer and returns a GLib::Strv wrapping it" do
9
+ describe '::wrap' do
10
+ it 'takes a pointer and returns a GLib::Strv wrapping it' do
11
11
  strv = GLib::Strv.wrap :some_pointer
12
12
  assert_instance_of GLib::Strv, strv
13
13
  assert_equal :some_pointer, strv.to_ptr
14
14
  end
15
15
  end
16
16
 
17
- describe "#each" do
18
- it "yields each string element" do
19
- ary = ["one", "two", "three"]
20
- ptrs = ary.map {|a| FFI::MemoryPointer.from_string(a)}
17
+ describe '#each' do
18
+ it 'yields each string element' do
19
+ ary = %w(one two three)
20
+ ptrs = ary.map { |a| FFI::MemoryPointer.from_string(a) }
21
21
  ptrs << nil
22
22
  block = FFI::MemoryPointer.new(:pointer, ptrs.length)
23
23
  block.write_array_of_pointer ptrs
@@ -27,18 +27,18 @@ describe GLib::Strv do
27
27
  strv.each do |str|
28
28
  arr << str
29
29
  end
30
- assert_equal ["one", "two", "three"], arr
30
+ assert_equal %w(one two three), arr
31
31
  end
32
32
 
33
- it "yields zero times for a Strv wrapping a null pointer" do
33
+ it 'yields zero times for a Strv wrapping a null pointer' do
34
34
  strv = GLib::Strv.new FFI::Pointer.new(0)
35
- strv.each do |str|
35
+ strv.each do |_str|
36
36
  flunk
37
37
  end
38
38
  end
39
39
  end
40
40
 
41
- it "includes Enumerable" do
41
+ it 'includes Enumerable' do
42
42
  GLib::Strv.must_include Enumerable
43
43
  end
44
44
  end
data/test/gir_ffi_test.rb CHANGED
@@ -3,19 +3,19 @@ require 'gir_ffi_test_helper'
3
3
  GirFFI.setup :GIMarshallingTests
4
4
 
5
5
  describe GirFFI do
6
- it "sets up cairo as Cairo" do
6
+ it 'sets up cairo as Cairo' do
7
7
  GirFFI.setup :cairo
8
8
  assert Object.const_defined?(:Cairo)
9
9
  end
10
10
 
11
- it "sets up xlib, which has no shared library" do
11
+ it 'sets up xlib, which has no shared library' do
12
12
  gir = GObjectIntrospection::IRepository.default
13
13
  gir.require 'xlib'
14
- assert_nil gir.shared_library('xlib'), "Precondition for test failed"
14
+ assert_nil gir.shared_library('xlib'), 'Precondition for test failed'
15
15
  GirFFI.setup :xlib
16
16
  end
17
17
 
18
- it "sets up dependencies" do
18
+ it 'sets up dependencies' do
19
19
  save_module :GObject
20
20
  save_module :Regress
21
21
  GirFFI.setup :Regress
@@ -24,67 +24,67 @@ describe GirFFI do
24
24
  restore_module :GObject
25
25
  end
26
26
 
27
- describe "::define_type" do
28
- describe "without a block" do
27
+ describe '::define_type' do
28
+ describe 'without a block' do
29
29
  before do
30
30
  @klass = Class.new GIMarshallingTests::OverridesObject
31
31
  Object.const_set "DerivedA#{Sequence.next}", @klass
32
32
  @gtype = GirFFI.define_type @klass
33
33
  end
34
34
 
35
- it "returns a GType for the derived class" do
35
+ it 'returns a GType for the derived class' do
36
36
  parent_gtype = GIMarshallingTests::OverridesObject.get_gtype
37
37
  @gtype.wont_equal parent_gtype
38
38
  GObject.type_name(@gtype).must_equal @klass.name
39
39
  end
40
40
 
41
- it "makes #get_gtype on the registered class return the new GType" do
41
+ it 'makes #get_gtype on the registered class return the new GType' do
42
42
  @klass.get_gtype.must_equal @gtype
43
43
  end
44
44
 
45
- it "registers a type with the same size as the parent" do
45
+ it 'registers a type with the same size as the parent' do
46
46
  q = GObject.type_query @gtype
47
47
  q.instance_size.must_equal GIMarshallingTests::OverridesObject::Struct.size
48
48
  end
49
49
 
50
- it "creates a struct class for the derived class with just one member" do
50
+ it 'creates a struct class for the derived class with just one member' do
51
51
  @klass::Struct.members.must_equal [:parent]
52
52
  end
53
53
 
54
- it "allows the new class to be instantiated" do
54
+ it 'allows the new class to be instantiated' do
55
55
  obj = @klass.new
56
56
  type = GObject.type_from_instance obj
57
57
  type.must_equal @gtype
58
58
  end
59
59
 
60
- it "makes GirFFI find the new class by GType" do
60
+ it 'makes GirFFI find the new class by GType' do
61
61
  klass = GirFFI::Builder.build_by_gtype @gtype
62
62
  klass.must_equal @klass
63
63
  end
64
64
  end
65
65
 
66
- describe "with a block with a call to #install_property" do
66
+ describe 'with a block with a call to #install_property' do
67
67
  before do
68
68
  @klass = Class.new GIMarshallingTests::OverridesObject
69
69
  Object.const_set "DerivedB#{Sequence.next}", @klass
70
70
  @gtype = GirFFI.define_type @klass do |info|
71
- info.install_property GObject.param_spec_int("foo", "foo bar",
72
- "The Foo Bar Property",
71
+ info.install_property GObject.param_spec_int('foo', 'foo bar',
72
+ 'The Foo Bar Property',
73
73
  10, 20, 15,
74
74
  3)
75
75
  end
76
76
  end
77
77
 
78
- it "registers a type that is bigger than the parent" do
78
+ it 'registers a type that is bigger than the parent' do
79
79
  q = GObject.type_query @gtype
80
80
  q.instance_size.must_be :>, GIMarshallingTests::OverridesObject::Struct.size
81
81
  end
82
82
 
83
- it "gives the types Struct the fields :parent and :foo" do
83
+ it 'gives the types Struct the fields :parent and :foo' do
84
84
  @klass::Struct.members.must_equal [:parent, :foo]
85
85
  end
86
86
 
87
- it "creates accessor functions for the property" do
87
+ it 'creates accessor functions for the property' do
88
88
  obj = @klass.new
89
89
  obj.foo = 13
90
90
  obj.foo.must_equal 13
@@ -4,17 +4,13 @@ require 'gir_ffi'
4
4
 
5
5
  # Global sequence provider. Needed to make unique class names.
6
6
  class Sequence
7
- @@seq = 0
8
7
  def self.next
9
- @@seq += 1
8
+ @seq ||= 0
9
+ @seq += + 1
10
10
  end
11
11
  end
12
12
 
13
- class Minitest::Test
14
- def cws code
15
- code.gsub(/(^\s*|\s*$)/, "")
16
- end
17
-
13
+ module GirFFITestExtensions
18
14
  def get_field_introspection_data namespace, klass, name
19
15
  get_introspection_data(namespace, klass).find_field name
20
16
  end
@@ -38,21 +34,19 @@ class Minitest::Test
38
34
  SAVED_MODULES = {}
39
35
 
40
36
  def save_module name
41
- if Object.const_defined? name
42
- puts "Saving #{name} over existing" if SAVED_MODULES.has_key? name
43
- SAVED_MODULES[name] = Object.const_get name
44
- Object.send(:remove_const, name)
45
- end
37
+ return unless Object.const_defined? name
38
+ puts "Saving #{name} over existing" if SAVED_MODULES.key? name
39
+ SAVED_MODULES[name] = Object.const_get name
40
+ Object.send(:remove_const, name)
46
41
  end
47
42
 
48
43
  def restore_module name
49
44
  if Object.const_defined? name
50
45
  Object.send(:remove_const, name)
51
46
  end
52
- if SAVED_MODULES.has_key? name
53
- Object.const_set name, SAVED_MODULES[name]
54
- SAVED_MODULES.delete name
55
- end
47
+ return unless SAVED_MODULES.key? name
48
+ Object.const_set name, SAVED_MODULES[name]
49
+ SAVED_MODULES.delete name
56
50
  end
57
51
 
58
52
  def ref_count object
@@ -60,11 +54,11 @@ class Minitest::Test
60
54
  end
61
55
 
62
56
  def max_for_unsigned_type type
63
- ( 1 << (FFI.type_size(type) * 8) ) - 1
57
+ (1 << (FFI.type_size(type) * 8)) - 1
64
58
  end
65
59
 
66
60
  def max_for_type type
67
- ( 1 << (FFI.type_size(type) * 8 - 1) ) - 1
61
+ (1 << (FFI.type_size(type) * 8 - 1)) - 1
68
62
  end
69
63
 
70
64
  def min_for_type type
@@ -105,3 +99,4 @@ class Minitest::Test
105
99
  end
106
100
  end
107
101
 
102
+ Minitest::Test.send :include, GirFFITestExtensions
@@ -3,24 +3,24 @@ require 'gir_ffi_test_helper'
3
3
  GirFFI.setup :Regress
4
4
 
5
5
  # Tests deriving Ruby classes from GObject classes.
6
- describe "For derived classes" do
7
- describe "setting up methods when first called" do
6
+ describe 'For derived classes' do
7
+ describe 'setting up methods when first called' do
8
8
  before do
9
9
  save_module :GIMarshallingTests
10
10
  GirFFI.setup :GIMarshallingTests
11
11
  end
12
12
 
13
- describe "when an interface is mixed in" do
13
+ describe 'when an interface is mixed in' do
14
14
  before do
15
15
  @klass = Class.new GIMarshallingTests::OverridesObject
16
16
  @klass.send :include, GIMarshallingTests::Interface
17
17
  end
18
18
 
19
- it "finds class methods in the superclass" do
19
+ it 'finds class methods in the superclass' do
20
20
  @klass.returnv
21
21
  end
22
22
 
23
- it "finds instance methods in the superclass" do
23
+ it 'finds instance methods in the superclass' do
24
24
  obj = @klass.new
25
25
  result = obj.method
26
26
  result.must_equal 42
@@ -32,10 +32,10 @@ describe "For derived classes" do
32
32
  end
33
33
  end
34
34
 
35
- describe "the initializer" do
36
- it "does not have to call super" do
35
+ describe 'the initializer' do
36
+ it 'does not have to call super' do
37
37
  klass = Class.new Regress::TestSubObj do
38
- def initialize *args
38
+ def initialize *_args
39
39
  end
40
40
  end
41
41