Sha256: 0ebf3ab4e83bc15663482e707011337a512707951503fa86d06a0f1a8b2fa857

Contents?: true

Size: 822 Bytes

Versions: 22

Compression:

Stored size: 822 Bytes

Contents

require 'gir_ffi_test_helper'

# Tests how methods are looked up and generated on first use.
describe "Looking up methods" do
  before do
    save_module :Regress
    GirFFI.setup :Regress
  end

  describe "an instance method" do
    it "is found from a subclass" do
      assert_defines_instance_method Regress::TestObj, :forced_method
      refute_defines_instance_method Regress::TestSubObj, :forced_method

      sub_object = Regress::TestSubObj.new
      sub_object.forced_method
    end
  end

  describe "a class method" do
    it "is found from a subclass" do
      assert_defines_singleton_method Regress::TestObj, :static_method
      refute_defines_singleton_method Regress::TestSubObj, :static_method

      Regress::TestSubObj.static_method 42
    end
  end

  after do
    restore_module :Regress
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
gir_ffi-0.7.7 test/integration/method_lookup_test.rb
gir_ffi-0.7.6 test/integration/method_lookup_test.rb
gir_ffi-0.7.5 test/integration/method_lookup_test.rb
gir_ffi-0.7.4 test/integration/method_lookup_test.rb
gir_ffi-0.7.3 test/integration/method_lookup_test.rb
gir_ffi-0.7.2 test/integration/method_lookup_test.rb
gir_ffi-0.7.1 test/integration/method_lookup_test.rb
gir_ffi-0.7.0 test/integration/method_lookup_test.rb
gir_ffi-0.6.7 test/integration/method_lookup_test.rb
gir_ffi-0.6.6 test/integration/method_lookup_test.rb
gir_ffi-0.6.5 test/integration/method_lookup_test.rb
gir_ffi-0.6.4 test/integration/method_lookup_test.rb
gir_ffi-0.6.3 test/integration/method_lookup_test.rb
gir_ffi-0.6.2 test/integration/method_lookup_test.rb
gir_ffi-0.6.1 test/integration/method_lookup_test.rb
gir_ffi-0.6.0 test/integration/method_lookup_test.rb
gir_ffi-0.5.2 test/integration/method_lookup_test.rb
gir_ffi-0.5.1 test/integration/method_lookup_test.rb
gir_ffi-0.5.0 test/integration/method_lookup_test.rb
gir_ffi-0.4.3 test/integration/method_lookup_test.rb