spec/array_spec.rb in bindata-1.4.2 vs spec/array_spec.rb in bindata-1.4.3
- old
+ new
@@ -276,9 +276,15 @@
subject = BinData::Array.new(:type => :int16be, :read_until => :eof)
subject.read "\x00\x01\x00\x02\x03"
subject.should == [1, 2]
end
+
+ it "should report exceptions" do
+ array_type = [:string, {:read_length => lambda { unknown_variable }}]
+ subject = BinData::Array.new(:type => array_type, :read_until => :eof)
+ lambda { subject.read "\x00\x01\x00\x02\x03" }.should raise_error
+ end
end
end
describe BinData::Array, "nested within an Array" do
subject {