Sha256: 086b3070a6d698b9fd23b5b2d5462a47693fd63f819e3559331732a7d07d3e0c

Contents?: true

Size: 676 Bytes

Versions: 5

Compression:

Stored size: 676 Bytes

Contents

#!/usr/bin/env ruby

require File.expand_path(File.join(File.dirname(__FILE__), "spec_common"))
require 'bindata/skip'

describe BinData::Skip do
  subject { BinData::Skip.new(:length => 5) }
  let(:io) { StringIO.new("abcdefghij") }

  it { should == "" }
  its(:to_binary_s) { should == "\000" * 5 }

  it "should skip bytes" do
    subject.read(io)
    io.pos.should == 5
  end

  it "should have expected binary representation after setting value" do
    subject.assign("123")
    subject.to_binary_s.should == "\000" * 5
  end

  it "should have expected binary representation after reading" do
    subject.read(io)
    subject.to_binary_s.should == "\000" * 5
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bindata-1.4.3 spec/skip_spec.rb
bindata-1.4.2 spec/skip_spec.rb
bindata-1.4.1 spec/skip_spec.rb
bindata-1.4.0 spec/skip_spec.rb
bindata-1.3.1 spec/skip_spec.rb