<commit_before>Feature: have(n).items matcher

  RSpec provides several matchers that make it easy to set expectations about the
  size of a collection.  There are three basic forms:

    * collection.should have(x).items
    * collection.should have_at_least(x).items
    * collection.should have_at_most(x).items

  In addition, #have_exactly is provided as an alias to #have.

  These work on any collection-like object--the object just needs to respond to #size
  or #length (or both).  When the matcher is called directly on a collection object,
  the #items call is pure syntactic sugar.  You can use anything you want here.  These
  are equivalent:

    * collection.should have(x).items
    * collection.should have(x).things

  You can also use this matcher on a non-collection object that returns a collection
  from one of its methods.  For example, Dir#entries returns an array, so you could
  set an expectation using the following:

    Dir.new("my/directory").should have(7).entries

  Scenario: have(x).items on a collection
    Given a file named "have_items_spec.rb" with:
      """
      describe [1, 2, 3] do
        it { should have(3).items }<commit_msg>fix: missing underscores escaping in "have" feature description http://relishapp.com/rspec/rspec-expectations/v/2-6/dir/built-in-matchers/have-n-items-matcher<commit_after>Feature: have(n).items matcher

  RSpec provides several matchers that make it easy to set expectations about the
  size of a collection.  There are three basic forms:

    * collection.should have(x).items
    * collection.should have\_at\_least(x).items
    * collection.should have\_at\_most(x).items

  In addition, #have_exactly is provided as an alias to #have.

  These work on any collection-like object--the object just needs to respond to #size
  or #length (or both).  When the matcher is called directly on a collection object,
  the #items call is pure syntactic sugar.  You can use anything you want here.  These
  are equivalent:

    * collection.should have(x).items
    * collection.should have(x).things

  You can also use this matcher on a non-collection object that returns a collection
  from one of its methods.  For example, Dir#entries returns an array, so you could
  set an expectation using the following:

    Dir.new("my/directory").should have(7).entries

  Scenario: have(x).items on a collection
    Given a file named "have_items_spec.rb" with:
      """
      describe [1, 2, 3] do
        it { should have(3).items }
{'fraction_non_alphanumeric': 0.07956817273090763, 'fraction_numerical': 0.004798080767692923, 'mean_word_length': 3.5162454873646207, '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': '1068769', 'n_tokens_mistral': 720, 'n_tokens_neox': 693, 'n_words': 296}