<commit_before>module ShellMock
  class CallVerifier
    def initialize
      match_calls_when { |calls| calls.any? }
    end

    def times(n)
      match_calls_when { |calls| calls.size == n }

      self
    end

    def fewer_than(n)
      match_calls_when { |calls| calls.size < n }

      self
    end
    alias less_than fewer_than

    def more_than(n)
      match_calls_when { |calls| calls.size > n }

      self
    end

    def once
      times(1)
    end

    def never
      times(0)
    end

    def matches?(actual)
      @actual = actual

      condition.call(actual.calls)
    end

    def failure_message
      "#{actual.command} was expected."
    end

    def failure_message_when_negated
      "#{actual.command} was not expected."
    end

    private

    attr_reader :actual, :condition

    def match_calls_when(&blk)
      @condition = blk
    end
  end
end<commit_msg>changing actual to a domain term made the class easier to understand<commit_after>module ShellMock
  class CallVerifier
    def initialize
      match_calls_when { |calls| calls.any? }
    end

    def times(n)
      match_calls_when { |calls| calls.size == n }

      self
    end

    def fewer_than(n)
      match_calls_when { |calls| calls.size < n }

      self
    end
    alias less_than fewer_than

    def more_than(n)
      match_calls_when { |calls| calls.size > n }

      self
    end

    def once
      times(1)
    end

    def never
      times(0)
    end

    def matches?(command_stub)
      @command_stub = command_stub

      condition.call(command_stub.calls)
    end

    def failure_message
      "#{command_stub.command} was expected."
    end

    def failure_message_when_negated
      "#{command_stub.command} was not expected."
    end

    private

    attr_reader :command_stub, :condition

    def match_calls_when(&blk)
      @condition = blk
    end
  end
end
{'fraction_non_alphanumeric': 0.07305452620434093, 'fraction_numerical': 0.0021175224986765486, 'mean_word_length': 2.1711409395973154, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7197586', 'n_tokens_mistral': 616, 'n_tokens_neox': 618, 'n_words': 160}