spec/symbolmatrix/serialization_spec.rb in symbolmatrix-1.1.0 vs spec/symbolmatrix/serialization_spec.rb in symbolmatrix-1.1.1
- old
+ new
@@ -1,9 +1,14 @@
require 'complete_features_helper'
describe SymbolMatrix::Serialization do
describe '.parse' do
+ it 'should parse an empty string' do
+ sm = SymbolMatrix::Serialization.parse ""
+ sm.keys.should be_empty
+ end
+
it 'should parse a simple string aja:hola' do
sm = SymbolMatrix::Serialization.parse 'aja:hola'
sm.aja.should == 'hola'
end
@@ -101,9 +106,16 @@
context "a SymbolMatrix serialization is provided" do
it 'should load the data into self' do
a = SymbolMatrix.new "those.pesky:attempts of.making.it:work"
a.those.pesky.should == "attempts"
a.of.making.it.should == "work"
+ end
+ end
+
+ context "an empty string is provided" do
+ it 'should load nothing into the SymbolMatrix' do
+ a = SymbolMatrix ""
+ a.keys.should be_empty
end
end
end
end
\ No newline at end of file