<commit_before>require 'introspection_test_helper'

describe "loading the shared library" do
  before do
    # Avoid cluttering the error stream with method redefinition warnings.
    stub(GObjectIntrospection::Lib).attach_function { }
  end

  describe "with ABI version 0 installed" do
    before do
      stub(GObjectIntrospection::Lib).ffi_lib("girepository-1.0.so.1") { raise LoadError }
      stub(GObjectIntrospection::Lib).ffi_lib("girepository-1.0.so.0") { }
      stub(GObjectIntrospection::Lib).ffi_lib("girepository-1.0") { raise "not expected" }
    end

    it "prints a warning message" do
      _, err = capture_io do
        load 'ffi-gobject_introspection/lib.rb'
      end

      assert_match(/not supported/, err)
    end
  end

  describe "with ABI version 1 installed" do
    before do
      stub(GObjectIntrospection::Lib).ffi_lib("girepository-1.0.so.0") { raise LoadError }
      stub(GObjectIntrospection::Lib).ffi_lib("girepository-1.0.so.1") { }
      stub(GObjectIntrospection::Lib).ffi_lib("girepository-1.0") { raise "not expected" }
    end

    it "does not print a warning message" do
      _, err = capture_io do
        load 'ffi-gobject_introspection/lib.rb'
      end

      assert_equal "", err
    end
  end

  describe "without being able to determine the ABI version" do
    before do
      stub(GObjectIntrospection::Lib).ffi_lib("girepository-1.0.so.0") { raise LoadError }
      stub(GObjectIntrospection::Lib).ffi_lib("girepository-1.0.so.1") { raise LoadError }
      stub(GObjectIntrospection::Lib).ffi_lib("girepository-1.0") { }
    end

    it "prints a warning message" do
      _, err = capture_io do
        load 'ffi-gobject_introspection/lib.rb'
      end

      assert_match(/not supported/, err)
    end
  end
end<commit_msg>Remove tests for removed library version check<commit_after>require 'introspection_test_helper'
{'fraction_non_alphanumeric': 0.10649627263045794, 'fraction_numerical': 0.013844515441959531, 'mean_word_length': 3.3394919168591226, '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': '4321636', 'n_tokens_mistral': 625, 'n_tokens_neox': 627, 'n_words': 137}