Sha256: b6f26c0c60c399f31a0b668a89e8bd8996eafef98ab1ea8a4e9e4584228a60a2
Contents?: true
Size: 964 Bytes
Versions: 19
Compression:
Stored size: 964 Bytes
Contents
require 'spec_helper' require 'volt/models' describe Volt::Persistors::Store do it 'should tell the persistor when the model has changed' do persistor = double('volt/persistor') persistor_instance = double('volt/persistor instance') expect(persistor_instance).to receive(:loaded) expect(persistor).to receive(:new).and_return(persistor_instance) @model = Volt::Model.new(nil, persistor: persistor) expect(persistor_instance).to receive(:changed) @model._attr = 'yes' end it 'should tell the persistor when something is added to an array model' do persistor = double('volt/persistor') persistor_instance = double('volt/persistor instance') expect(persistor_instance).to receive(:loaded) expect(persistor).to receive(:new).and_return(persistor_instance) @model = Volt::ArrayModel.new([1, 2, 3], persistor: persistor) expect(persistor_instance).to receive(:added).with(4, 3) @model << 4 end end
Version data entries
19 entries across 19 versions & 1 rubygems