Sha256: 8a2a801c92ba8bcf2bfa43aae9fd1711faadb3f84baa8e10407542740536077d
Contents?: true
Size: 1.3 KB
Versions: 2
Compression:
Stored size: 1.3 KB
Contents
require File.expand_path('test_helper.rb', File.dirname(__FILE__)) module GirFFI class IRepositoryTest < MiniTest::Spec context "An IRepository object" do should "not be created by calling new()" do assert_raises NoMethodError do IRepository.new end end should "be created by calling default()" do gir = IRepository.default assert_kind_of IRepository, gir end should "be a singleton" do gir = IRepository.default gir2 = IRepository.default assert_equal gir, gir2 end end context "The namespace method" do should "raise an error if the namespace doesn't exist" do assert_raises RuntimeError do IRepository.default.require 'VeryUnlikelyGObjectNamespaceName', nil end end should "allow version to be nil" do assert_nothing_raised do IRepository.default.require 'GObject', nil end end should "allow version to be left out" do assert_nothing_raised do IRepository.default.require 'GObject' end end end context "Enumerating the infos" do setup do @gir = IRepository.default end should "yield more than one object" do assert_operator @gir.n_infos('Gtk'), :>, 0 end should "yield IBaseInfo objects" do assert_kind_of IBaseInfo, @gir.info('Gtk', 0) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
gir_ffi-0.0.10 | test/i_repository_test.rb |
gir_ffi-0.0.9 | test/i_repository_test.rb |