Thursday, June 04, 2026 1:49:16 AM
> test_to_or_sentence_active_support.rb
# frozen_string_literal: true

require "test_helper"

class TestArrayToOrSentence < Minitest::Test
  def it_works_with_multiple_items
    result = ["apples", "oranges", "bananas"].to_or_sentence
    assert_equal("apples, oranges, or bananas", result)
  end

  def it_works_with_two_items
    result = ["apples", "oranges"].to_or_sentence
    assert_equal("apples or oranges", result)
  end

  def it_supports_overwriting_options
    result = ["apples", "oranges", "bananas"].to_or_sentence(last_word_connector: " or ")
    assert_equal("apples, oranges or bananas", result)
  end
end
All opinions represented herein are my own
- © 2024 - 2026 itsthedevman
- build 4294fb2