Sha256: b473c50f855b83150a3cb8ab5a0c5b2f0c88e67206771546cb22ab49387f5e0f

Contents?: true

Size: 544 Bytes

Versions: 10

Compression:

Stored size: 544 Bytes

Contents

require 'gir_ffi_test_helper'

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

  describe '#safe_name' do
    it 'keeps lower case names lower case' do
      expect(info).to receive(:name).and_return 'foo'

      assert_equal 'foo', info.safe_name
    end

    it 'returns a non-empty string if name is empty' do
      expect(info).to receive(:name).and_return ''

      assert_equal '_', info.safe_name
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
gir_ffi-0.9.2 test/gir_ffi/info_ext/safe_function_name_test.rb
gir_ffi-0.9.1 test/gir_ffi/info_ext/safe_function_name_test.rb
gir_ffi-0.9.0 test/gir_ffi/info_ext/safe_function_name_test.rb
gir_ffi-0.8.6 test/gir_ffi/info_ext/safe_function_name_test.rb
gir_ffi-0.8.5 test/gir_ffi/info_ext/safe_function_name_test.rb
gir_ffi-0.8.4 test/gir_ffi/info_ext/safe_function_name_test.rb
gir_ffi-0.8.3 test/gir_ffi/info_ext/safe_function_name_test.rb
gir_ffi-0.8.2 test/gir_ffi/info_ext/safe_function_name_test.rb
gir_ffi-0.8.1 test/gir_ffi/info_ext/safe_function_name_test.rb
gir_ffi-0.8.0 test/gir_ffi/info_ext/safe_function_name_test.rb