Sha256: f3bf39b530ed9c98bfcfa798cf9a5bb1409490c86a510f84c80724ffa8ca5082

Contents?: true

Size: 653 Bytes

Versions: 1

Compression:

Stored size: 653 Bytes

Contents

require_relative 'spec_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

1 entries across 1 versions & 1 rubygems

Version Path
lovely_rufus-0.2.1 spec/lovely_rufus_spec.rb