Sha256: bfd69c0a0adc47597b92d20bd47526f53eff763dfc38c315d6e03ff62bd51420

Contents?: true

Size: 617 Bytes

Versions: 5

Compression:

Stored size: 617 Bytes

Contents

#!/usr/bin/env ruby

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

describe BinData::Rest do
  it { should == "" }

  it "reads till end of stream" do
    data = "abcdefghij"
    subject.read(data).should == data
  end

  it "allows setting value for completeness" do
    subject.assign("123")
    subject.should == "123"
    subject.to_binary_s.should == "123"
  end

  it "accepts BinData::BasePrimitive parameters" do
    rest = BinData::Rest.new(:check_value => "abc")
    expect {
      rest.read("xyz")
    }.to raise_error(BinData::ValidityError)
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
jbangert-bindata-1.5.0 spec/rest_spec.rb
bindata-1.5.1 spec/rest_spec.rb
bindata-1.5.0 spec/rest_spec.rb
bindata-1.4.5 spec/rest_spec.rb
bindata-1.4.4 spec/rest_spec.rb