<commit_before>RSpec::Matchers.define :be_installed do
  match do |name|
    if @provider.nil?
      backend.check_installed(name)
    elsif @provider == 'gem'
      backend.check_installed_by_gem(name, @version)
    end
  end
  chain :by do |provider|
    @provider = provider
  end
  chain :with_version do |version|
    @version = version
  end
end<commit_msg>The style of be_running implemented by kentaro is cool. So I implemented be_isntalled like that.<commit_after>RSpec::Matchers.define :be_installed do
  match do |name|
    if @provider.nil?
      backend.check_installed(name)
    else
      check_method = "check_installed_by_#{@provider}".to_sym

      unless backend.respond_to?(check_method)
        raise ArgumentError.new("`be_installed` matcher doesn't support #{@under}")
      end

      backend.send(check_method, name, @version)
    end
  end

  chain :by do |provider|
    @provider = provider
  end

  chain :with_version do |version|
    @version = version
  end

end
{'fraction_non_alphanumeric': 0.09264853977844914, 'fraction_numerical': 0.0, 'mean_word_length': 3.4573991031390134, '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': '6257080', 'n_tokens_mistral': 323, 'n_tokens_neox': 313, 'n_words': 85}