Module: RSpec::PathMatchers::Refinements::ArrayRefinements

Defined in:
lib/rspec/path_matchers/refinements.rb

Overview

Refinements for Array to provide a to_sentence method

Examples:

using RSpec::PathMatchers::Refinements::ArrayRefinements

Constant Summary collapse

DEFAULT_SENTENCE_OPTIONS =
Data.define(:conjunction, :delimiter, :oxford) do
  def initialize(conjunction: 'and', delimiter: ',', oxford: true)
    super
  end

  def two_word_connector
    "#{delimiter} "
  end

  def last_word_connector
    oxford ? "#{delimiter} #{conjunction} " : " #{conjunction} "
  end
end.new