Sha256: b3d78e5b94ff4124385253a5271b0dc2edc618837ab35f6e175682da957be6fb

Contents?: true

Size: 494 Bytes

Versions: 8

Compression:

Stored size: 494 Bytes

Contents

require 'gir_ffi_test_helper'

describe GirFFI::Builders::ModuleBuilder do
  describe "#build_namespaced_class" do
    it "raises a clear error if the named class does not exist" do
      gir = GObjectIntrospection::IRepository.default
      stub(gir).require("Foo", nil) { }

      builder = GirFFI::Builders::ModuleBuilder.new "Foo"

      mock(gir).find_by_name("Foo", "Bar") { nil }

      assert_raises NameError do
        builder.build_namespaced_class :Bar
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
gir_ffi-0.7.7 test/gir_ffi/builders/module_builder_test.rb
gir_ffi-0.7.6 test/gir_ffi/builders/module_builder_test.rb
gir_ffi-0.7.5 test/gir_ffi/builders/module_builder_test.rb
gir_ffi-0.7.4 test/gir_ffi/builders/module_builder_test.rb
gir_ffi-0.7.3 test/gir_ffi/builders/module_builder_test.rb
gir_ffi-0.7.2 test/gir_ffi/builders/module_builder_test.rb
gir_ffi-0.7.1 test/gir_ffi/builders/module_builder_test.rb
gir_ffi-0.7.0 test/gir_ffi/builders/module_builder_test.rb