Sha256: e64fda830b1dd977a94a2be2d95625ea175a8b745b587b9880c564b2b3c9d8d9
Contents?: true
Size: 887 Bytes
Versions: 126
Compression:
Stored size: 887 Bytes
Contents
# frozen_string_literal: true RSpec.describe :word_wrap do link :word_wrap, from: :ree_text it { expect(word_wrap("Once upon a time")).to eq("Once upon a time") expect( word_wrap( "Once upon a time, in a kingdom called Far Far Away, a king fell ill, and finding a successor to the throne turned out to be more trouble than anyone could have imagined..." ) ).to eq( "Once upon a time, in a kingdom called Far Far Away, a king fell ill, and finding\na successor to the throne turned out to be more trouble than anyone could have\nimagined..." ) expect(word_wrap("Once upon a time", line_width: 8)).to eq("Once\nupon a\ntime") expect(word_wrap("Once upon a time", line_width: 1)).to eq("Once\nupon\na\ntime") expect(word_wrap("Once upon a time", line_width: 1, break_sequence: "\r\n")).to eq("Once\r\nupon\r\na\r\ntime") } end
Version data entries
126 entries across 126 versions & 1 rubygems