Sha256: a8465b44c0cdad82e3d2657794898b41c049dbbcc97a99448cfbf48814b66a25

Contents?: true

Size: 653 Bytes

Versions: 2

Compression:

Stored size: 653 Bytes

Contents

require_relative 'test_helper'
require_relative '../lib/lovely_rufus'

describe LovelyRufus do
  describe '.wrap' do
    let(:text_wrapper) { fake(:text_wrapper, as: :class) }

    it 'offloads the wrapping to TextWrapper' do
      stub(text_wrapper).wrap('Ice Ice Baby', width: 7) { "Ice Ice\nBaby\n" }
      LovelyRufus.wrap('Ice Ice Baby', text_wrapper: text_wrapper, width: 7)
        .must_equal "Ice Ice\nBaby\n"
    end

    it 'wraps the passed String to 72 characters by default' do
      LovelyRufus.wrap 'Ice Ice Baby', text_wrapper: text_wrapper
      text_wrapper.must_have_received :wrap, ['Ice Ice Baby', { width: 72 }]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lovely_rufus-0.3.1 test/lovely_rufus_test.rb
lovely_rufus-0.3.0 test/lovely_rufus_test.rb