Sha256: 4a2de79f0893bb8e9ac30a6b39883bccbc07f789c928594d2d96422bea04839c

Contents?: true

Size: 723 Bytes

Versions: 4

Compression:

Stored size: 723 Bytes

Contents

#!/usr/bin/env ruby

require File.expand_path(File.dirname(__FILE__)) + '/spec_common'
require 'bindata/rest'

describe BinData::Rest do
  it "should read till end of stream" do
    data = "abcdefghij"
    BinData::Rest.read(data).should == data
  end

  it "should default to the empty string" do
    BinData::Rest.new.value.should == ""
  end

  it "should allow setting value for completeness" do
    rest = BinData::Rest.new
    rest.value = "123"
    rest.value.should == "123"
    rest.to_s.should == "123"
  end

  it "should accept BinData::Single parameters" do
    rest = BinData::Rest.new(:check_value => "abc")
    lambda {
      rest.read("abc")
    }.should_not raise_error(BinData::ValidityError)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bindata-0.9.0 spec/rest_spec.rb
bindata-0.9.1 spec/rest_spec.rb
bindata-0.9.2 spec/rest_spec.rb
bindata-0.9.3 spec/rest_spec.rb