Sha256: 1afa91b89dd0a5ac988659552d63cd09450bfa5e6b748fd5030194f5ba7d9c02

Contents?: true

Size: 626 Bytes

Versions: 6

Compression:

Stored size: 626 Bytes

Contents

require File.expand_path('../test_helper.rb', File.dirname(__FILE__))

describe GObjectIntrospection::IFunctionInfo do
  describe "#safe_name" do
    it "keeps lower case names lower case" do
      stub(ptr = Object.new).null? { false }
      info = GObjectIntrospection::IFunctionInfo.wrap ptr
      stub(info).name { "foo" }

      assert_equal "foo", info.safe_name
    end

    it "returns a non-empty string if name is empty" do
      stub(ptr = Object.new).null? { false }
      info = GObjectIntrospection::IFunctionInfo.wrap ptr
      stub(info).name { "" }

      assert_equal "_", info.safe_name
    end
  end
end


Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gir_ffi-0.4.0 test/ffi-gobject_introspection/i_function_info_test.rb
gir_ffi-0.3.2 test/ffi-gobject_introspection/i_function_info_test.rb
gir_ffi-0.3.1 test/ffi-gobject_introspection/i_function_info_test.rb
gir_ffi-0.3.0 test/ffi-gobject_introspection/i_function_info_test.rb
gir_ffi-0.2.3 test/ffi-gobject_introspection/i_function_info_test.rb
gir_ffi-0.2.2 test/ffi-gobject_introspection/i_function_info_test.rb