gir_ffi 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ == 0.6.2 / 2013-06-14
2
+
3
+ * Handle introspectable types with introspectable parent types
4
+
1
5
  == 0.6.1 / 2013-06-09
2
6
 
3
7
  * Handle SizedArray containing enums
@@ -21,7 +21,8 @@ module GirFFI
21
21
  end
22
22
 
23
23
  def parent
24
- @gir.find_by_gtype @gobject.type_parent(@g_type)
24
+ parent_gtype = @gobject.type_parent(@g_type)
25
+ @gir.find_by_gtype(parent_gtype) || self.class.new(parent_gtype, @gir, @gobject)
25
26
  end
26
27
 
27
28
  def namespace
@@ -1,3 +1,3 @@
1
1
  module GirFFI
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
3
3
  end
@@ -10,16 +10,32 @@ describe GirFFI::UnintrospectableTypeInfo do
10
10
  end
11
11
 
12
12
  describe "#parent" do
13
- it "finds the parent's info by gtype" do
14
- gobject = Object.new
15
- gir = Object.new
13
+ context "when the GIR knows about the parent gtype" do
14
+ it "finds the parent's info by gtype" do
15
+ gobject = Object.new
16
+ gir = Object.new
16
17
 
17
- mock(gobject).type_parent(:some_type) { :foo }
18
- mock(gir).find_by_gtype(:foo) { :foo_info }
18
+ mock(gobject).type_parent(:some_type) { :foo }
19
+ mock(gir).find_by_gtype(:foo) { :foo_info }
19
20
 
20
- info = GirFFI::UnintrospectableTypeInfo.new(:some_type, gir, gobject)
21
+ info = GirFFI::UnintrospectableTypeInfo.new(:some_type, gir, gobject)
22
+
23
+ info.parent.must_equal :foo_info
24
+ end
25
+ end
26
+
27
+ context "when the GIR does not know about the parent gtype" do
28
+ it "creates a new UnintrospectableTypeInfo from the parent gtype" do
29
+ gobject = Object.new
30
+ gir = Object.new
31
+
32
+ mock(gobject).type_parent(:some_type) { :foo }
33
+ mock(gir).find_by_gtype(:foo) { nil }
34
+
35
+ info = GirFFI::UnintrospectableTypeInfo.new(:some_type, gir, gobject)
21
36
 
22
- info.parent.must_equal :foo_info
37
+ info.parent.g_type.must_equal :foo
38
+ end
23
39
  end
24
40
  end
25
41
 
@@ -0,0 +1,17 @@
1
+ # coding: utf-8
2
+ require 'gir_ffi_test_helper'
3
+
4
+ GirFFI.setup :PangoFT2
5
+
6
+ # Tests generated methods and functions in the PangoFT2 namespace.
7
+ describe PangoFT2 do
8
+ describe PangoFT2::FontMap do
9
+ it "has a working method #load_font" do
10
+ font_map = PangoFT2::FontMap.new
11
+ context = font_map.create_context
12
+ font_description = Pango::FontDescription.new
13
+ font_map.load_font context, font_description
14
+ end
15
+ end
16
+ end
17
+
@@ -1,14 +1,12 @@
1
1
  # coding: utf-8
2
2
  require 'gir_ffi_test_helper'
3
3
 
4
- require 'gir_ffi'
5
-
6
4
  GirFFI.setup :Pango
7
5
 
8
6
  # Tests generated methods and functions in the Pango namespace.
9
7
  describe Pango do
10
8
  describe Pango::Language do
11
- it "has a working method get_scripts" do
9
+ it "has a working method #get_scripts" do
12
10
  lang = Pango::Language.from_string 'ja'
13
11
  result = lang.get_scripts
14
12
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gir_ffi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-09 00:00:00.000000000 Z
12
+ date: 2013-06-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
@@ -91,6 +91,22 @@ dependencies:
91
91
  - - ~>
92
92
  - !ruby/object:Gem::Version
93
93
  version: 10.0.3
94
+ - !ruby/object:Gem::Dependency
95
+ name: pry
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
94
110
  description:
95
111
  email:
96
112
  - matijs@matijs.net
@@ -211,6 +227,7 @@ files:
211
227
  - test/lib/autogen.sh
212
228
  - test/gir_ffi_test_helper.rb
213
229
  - test/ffi-gobject_test.rb
230
+ - test/integration/generated_pango_ft2_test.rb
214
231
  - test/integration/derived_classes_test.rb
215
232
  - test/integration/generated_regress_test.rb
216
233
  - test/integration/method_lookup_test.rb
@@ -383,6 +400,7 @@ test_files:
383
400
  - test/integration/generated_gimarshallingtests_test.rb
384
401
  - test/integration/generated_gio_test.rb
385
402
  - test/integration/generated_gobject_test.rb
403
+ - test/integration/generated_pango_ft2_test.rb
386
404
  - test/integration/generated_pango_test.rb
387
405
  - test/integration/generated_regress_test.rb
388
406
  - test/integration/method_lookup_test.rb