Sha256: 69d40d6d5eade565ced6c35cfb195a83324d7051ab802ad17e2b04cdef3ffc7f
Contents?: true
Size: 1.16 KB
Versions: 1
Compression:
Stored size: 1.16 KB
Contents
require_relative '../spec_helper' module LovelyRufus describe BasicWrapper do describe '#call' do it 'wraps text to the given width' do text = 'I go crazy when I hear a cymbal and a hi-hat ' \ 'with a souped-up tempo' wrap = <<-end.dedent I go crazy when I hear a cymbal and a hi-hat with a souped-up tempo end bw = BasicWrapper.new bw.call(Wrap[text, width: 22]).must_equal Wrap[wrap, width: 22] end it 'never extends past the given width, chopping words if necessary' do text = 'I’m killing your brain like a poisonous mushroom' wrap = <<-end.dedent I’m killi ng your brain like a poiso nous mushr oom end bw = BasicWrapper.new bw.call(Wrap[text, width: 5]).must_equal Wrap[wrap, width: 5] end it 'passes the fixed text to the next layer and returns its outcome' do final = fake :wrap layer = fake :layer mock(layer).call(Wrap["I\nO\nU\n", width: 2]) { final } BasicWrapper.new(layer).call(Wrap['I O U', width: 2]).must_equal final end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
lovely_rufus-0.1.0 | spec/lovely_rufus/basic_wrapper_spec.rb |