Sha256: fa9ba57df5538d908aa2cbf56420586675463d98b059b25ced489e94ce42d008
Contents?: true
Size: 1.36 KB
Versions: 1
Compression:
Stored size: 1.36 KB
Contents
require 'test_helper' require 'vedeu/support/persistence' module Vedeu describe Persistence do before { Persistence.reset } describe '.update' do it 'returns an Interface' do Persistence.update('dummy', { name: 'dumber' }) .must_be_instance_of(Interface) end it 'updates and returns the existing interface when the interface exists' do Persistence.update('dummy', { name: 'dumber' }).name .must_equal('dumber') end it 'returns a new interface when the interface does not exist' do Persistence.update('dummy', { name: 'dumber' }).name .must_equal('dumber') end end describe '#create' do it 'creates and returns the stored record' do Persistence.create({ name: 'dummy' }) .must_be_instance_of(Interface) end end describe '#query' do it 'returns the record when found' do Persistence.create({ name: 'hydrogen' }) Persistence.query('hydrogen').name.must_equal('hydrogen') end it 'raises an exception when the record cannot be found' do proc { Persistence.query('dummy') }.must_raise(EntityNotFound) end end describe '#reset' do it 'deletes all records stored' do Persistence.create({ name: 'dumb' }) Persistence.reset.must_equal({}) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vedeu-0.1.2 | test/lib/vedeu/support/persistence_test.rb |