<commit_before># encoding: UTF-8
# frozen_string_literal: true

module NRSER::RSpex::ExampleGroup
  
  # Create a new {RSpec.describe} section where the subject is set by
  # calling the parent subject with `args` and evaluate `block` in it.
  # 
  # @example
  #   describe "hi sayer" do
  #     subject{ ->( name ) { "Hi #{ name }!" } }
  #     
  #     describe_called_with 'Mom' do
  #       it { is_expected.to eq 'Hi Mom!' }
  #     end
  #   end
  # 
  # @param [Array] args
  #   Arguments to call `subject` with to produce the new subject.
  # 
  # @param [#call] body
  #   Block to execute in the context of the example group after refining
  #   the subject.
  # 
  # @return [void]
  # 
  def describe_called_with *args, &body
    describe_x Args(*args),
      type: :called_with,
      subject_block: -> { super().call *args },
      &body
  end # #describe_called_with
  
  # Short / old name
  alias_method :called_with, :describe_called_with
  
  
  # Version of {#describe_called_with} for when you have no arguments.
  # 
  # @param [#call] body
  #   Block to execute in the context of the example group after refining
  #   the subject.
  # 
  # @return [void]
  # 
  def describe_called &body
    describe_x Args(),
      type: :called_with,
      subject_block: -> { super().call },
      &body
  end
  
  alias_method :called, :describe_called
  alias_method :when_called, :describe_called
  
  
  
end # module NRSER::RSpex::ExampleGroup<commit_msg>Bold aliases<commit_after># encoding: UTF-8
# frozen_string_literal: true

module NRSER::RSpex::ExampleGroup
  
  # Create a new {RSpec.describe} section where the subject is set by
  # calling the parent subject with `args` and evaluate `block` in it.
  # 
  # @example
  #   describe "hi sayer" do
  #     subject{ ->( name ) { "Hi #{ name }!" } }
  #     
  #     describe_called_with 'Mom' do
  #       it { is_expected.to eq 'Hi Mom!' }
  #     end
  #   end
  # 
  # @param [Array] args
  #   Arguments to call `subject` with to produce the new subject.
  # 
  # @param [#call] body
  #   Block to execute in the context of the example group after refining
  #   the subject.
  # 
  # @return [void]
  # 
  def describe_called_with *args, &body
    describe_x Args(*args),
      type: :called_with,
      subject_block: -> { super().call *args },
      &body
  end # #describe_called_with
  
  # Short / old name
  alias_method :called_with, :describe_called_with

  # New / bold name
  alias_method :CALLED_WITH, :describe_called_with
  
  
  # Version of {#describe_called_with} for when you have no arguments.
  # 
  # @param [#call] body
  #   Block to execute in the context of the example group after refining
  #   the subject.
  # 
  # @return [void]
  # 
  def describe_called &body
    describe_x Args(),
      type: :called_with,
      subject_block: -> { super().call },
      &body
  end
  
  alias_method :called, :describe_called
  alias_method :when_called, :describe_called

  # new / bold name
  alias_method :CALLED, :describe_called
  
  
end # module NRSER::RSpex::ExampleGroup
{'fraction_non_alphanumeric': 0.1046133853151397, 'fraction_numerical': 0.000649772579597141, 'mean_word_length': 2.741190765492102, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3745002', 'n_tokens_mistral': 1060, 'n_tokens_neox': 1015, 'n_words': 308}