<commit_before>require 'gir_ffi_test_helper'

# Tests generated methods and functions in the GTop namespace. This namespace
# contains types with bad names, like 'glibtop_cpu'.
describe 'The generated GTop module' do
  before do
    GirFFI.setup :GTop
  end

  describe 'Glibtop' do
    it 'is a valid struct class' do
      GTop::Glibtop.ancestors.must_include GirFFI::StructBase
    end

    it 'can be created using Glibtop.init' do
      skip unless get_method_introspection_data 'GTop', 'glibtop', 'init'
      instance = GTop::Glibtop.init
      instance.must_be_kind_of GTop::Glibtop
    end
  end
end
<commit_msg>Skip GTop tests if introspection data is missing<commit_after>require 'gir_ffi_test_helper'

# Tests generated methods and functions in the GTop namespace. This namespace
# contains types with bad names, like 'glibtop_cpu'.
describe 'The generated GTop module' do
  before do
    begin
      GirFFI.setup :GTop
    rescue
      skip 'No GIR data for GTop available'
    end
  end

  describe 'Glibtop' do
    it 'is a valid struct class' do
      GTop::Glibtop.ancestors.must_include GirFFI::StructBase
    end

    it 'can be created using Glibtop.init' do
      skip unless get_method_introspection_data 'GTop', 'glibtop', 'init'
      instance = GTop::Glibtop.init
      instance.must_be_kind_of GTop::Glibtop
    end
  end
end

{'fraction_non_alphanumeric': 0.06656804733727811, 'fraction_numerical': 0.0, 'mean_word_length': 3.540268456375839, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '117807', 'n_tokens_mistral': 443, 'n_tokens_neox': 439, 'n_words': 145}