Sha256: b1380a3463792258cabd799a1f83dd81144714060ab5b6f871065a1a40c76f52

Contents?: true

Size: 719 Bytes

Versions: 3

Compression:

Stored size: 719 Bytes

Contents

require_relative '../spec_helper'

module LovelyRufus describe Wrap do
  describe '.[]' do
    it 'creates a Wrap with the given text and target width' do
      Wrap['Ice Ice Baby', width: 7].text.must_equal  'Ice Ice Baby'
      Wrap['Ice Ice Baby', width: 7].width.must_equal 7
    end

    it 'defaults to empty text and width of 72' do
      Wrap[].text.must_equal  ''
      Wrap[].width.must_equal 72
    end
  end

  describe '#text' do
    it 'accesses the text of the Wrap' do
      Wrap['Ice Ice Baby', width: 7].text.must_equal 'Ice Ice Baby'
    end
  end

  describe '#width' do
    it 'accesses the target width of the Wrap' do
      Wrap['Ice Ice Baby', width: 7].width.must_equal 7
    end
  end
end end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lovely_rufus-0.1.2 spec/lovely_rufus/wrap_spec.rb
lovely_rufus-0.1.1 spec/lovely_rufus/wrap_spec.rb
lovely_rufus-0.1.0 spec/lovely_rufus/wrap_spec.rb