test/spara_mem_test.rb in spara-0.0.1 vs test/spara_mem_test.rb in spara-0.0.2

- old
+ new

@@ -1,9 +1,12 @@ -require_relative './test_helper' +require_relative 'test_helper' describe SparaMem do - before { @db = SparaMem.new } + before do + @db = SparaMem.new + @db.clean! + end it '#initialize' do @db.must_be_instance_of SparaMem end @@ -41,8 +44,15 @@ @db.all.must_be_instance_of Hash @db.all.keys.must_include 'defined' @db.all.keys.wont_include 'undefined' @db.all.values.must_include 'i am not nil' @db.all.values.wont_include nil + end + + it '#clean!' do + @db.clean! + @db.keys.must_be_empty + @db.vals.must_be_empty + @db.all.must_equal({}) end end end