Sha256: 7f51f2638781aa22f7556192c93f005838defdd2bf8eb9745600f1b3bd15fbae

Contents?: true

Size: 495 Bytes

Versions: 7

Compression:

Stored size: 495 Bytes

Contents

require 'gir_ffi_test_helper'

describe GirFFI::InfoExt::SafeFunctionName do
  let(:testclass) { Class.new do
    include GirFFI::InfoExt::SafeFunctionName
  end }
  let(:info) { testclass.new }

  describe "#safe_name" do
    it "keeps lower case names lower case" do
      mock(info).name { "foo" }

      assert_equal "foo", info.safe_name
    end

    it "returns a non-empty string if name is empty" do
      mock(info).name { "" }

      assert_equal "_", info.safe_name
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
gir_ffi-0.6.3 test/gir_ffi/info_ext/safe_function_name_test.rb
gir_ffi-0.6.2 test/gir_ffi/info_ext/safe_function_name_test.rb
gir_ffi-0.6.1 test/gir_ffi/info_ext/safe_function_name_test.rb
gir_ffi-0.6.0 test/gir_ffi/info_ext/safe_function_name_test.rb
gir_ffi-0.5.2 test/gir_ffi/info_ext/safe_function_name_test.rb
gir_ffi-0.5.1 test/gir_ffi/info_ext/safe_function_name_test.rb
gir_ffi-0.5.0 test/gir_ffi/info_ext/safe_function_name_test.rb