require 'iounpack' describe IOUnpack do it 'has nothing to read, if empty directives' do expect( IOUnpack.new('').len).to eql(0) end <q< 19 q>2c3 19 q>2 c3 EOF /\A(\d+) (.*)/ it "wants read #$2 bytes for '#$1'" do expect( IOUnpack.new('cc').len).to eql(2) end end end