Sha256: 405a921fd00104654ca9f1fe0c256c075c36afa699c02796f4809cbf2a1e7220

Contents?: true

Size: 267 Bytes

Versions: 16

Compression:

Stored size: 267 Bytes

Contents

module AcceptanceTests
  module ArrayHelpers
    def to_sentence(array)
      if array.size == 1
        array[0]
      elsif array.size == 2
        array.join(' and ')
      else
        to_sentence(array[1..-2].join(', '), [array[-1]])
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
shoulda-4.0.0 test/support/acceptance/helpers/array_helpers.rb
shoulda-4.0.0.rc2 test/support/acceptance/helpers/array_helpers.rb
shoulda-4.0.0.rc1 test/support/acceptance/helpers/array_helpers.rb
shoulda-matchers-3.1.3 spec/support/acceptance/helpers/array_helpers.rb
shoulda-matchers-4.0.0.rc1 spec/support/acceptance/helpers/array_helpers.rb
shoulda-3.6.0 test/support/acceptance/helpers/array_helpers.rb
shoulda-matchers-3.1.2 spec/support/acceptance/helpers/array_helpers.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/shoulda-matchers-2.8.0/spec/support/acceptance/helpers/array_helpers.rb
shoulda-matchers-3.1.1 spec/support/acceptance/helpers/array_helpers.rb
shoulda-matchers-3.1.0 spec/support/acceptance/helpers/array_helpers.rb
shoulda-matchers-3.0.1 spec/support/acceptance/helpers/array_helpers.rb
shoulda-matchers-3.0.0 spec/support/acceptance/helpers/array_helpers.rb
shoulda-matchers-3.0.0.rc1 spec/support/acceptance/helpers/array_helpers.rb
shoulda-matchers-2.8.0 spec/support/acceptance/helpers/array_helpers.rb
shoulda-matchers-2.8.0.rc2 spec/support/acceptance/helpers/array_helpers.rb
shoulda-matchers-2.8.0.rc1 spec/support/acceptance/helpers/array_helpers.rb