<commit_before>require 'testing_env'
require 'compilers'

class CompilerSelectorTests < Homebrew::TestCase
  class Double
    attr_reader :name

    def initialize
      @failures = []
      @name = "double"
    end

    def <<(cc)
      @failures << CompilerFailure.create(cc)
      self
    end

    def fails_with?(compiler)
      @failures.any? { |failure| failure === compiler }
    end
  end
<commit_msg>Test CompilerSelector against a SoftwareSpec instance<commit_after>require 'testing_env'
require 'compilers'
require 'software_spec'

class CompilerSelectorTests < Homebrew::TestCase
  class Double < SoftwareSpec
    def <<(cc)
      fails_with(cc)
      self
    end
  end

{'fraction_non_alphanumeric': 0.0891812865497076, 'fraction_numerical': 0.0, 'mean_word_length': 3.3354430379746836, 'pattern_counts': {'":': 0, '<': 12, '<?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': '4661495', 'n_tokens_mistral': 208, 'n_tokens_neox': 205, 'n_words': 54}