spec/array_spec.rb in bindata-1.4.5 vs spec/array_spec.rb in bindata-1.5.0

- old
+ new

@@ -28,9 +28,15 @@ it "does not allow both :initial_length and :read_until" do args = {:initial_length => 3, :read_until => lambda { false } } expect { BinData::Array.new(args) }.to raise_error(ArgumentError) end + + it "accepts BinData::Base as :type" do + obj = BinData::Int8.new(:initial_value => 5) + array = BinData::Array.new(:type => obj, :initial_length => 1) + array.should == [5] + end end describe BinData::Array, "with no elements" do subject { BinData::Array.new(:type => :example_single) }