Sha256: ea270b01563ec19111bb6c796892298016285e4378f375a3aa42f083dceb3fc1
Contents?: true
Size: 1.09 KB
Versions: 17
Compression:
Stored size: 1.09 KB
Contents
require 'minitest_helper' describe Repository, 'Revert' do let(:repository) { Repository.new :test } it 'Insert' do repository[:countries].insert 'AR', name: 'Argentina' reverted_delta = repository.revert reverted_delta.must_equal 'countries' => {'AR' => {'action' => 'delete'}} repository.wont_be :changes? end it 'Update' do repository[:countries].insert 'AR', name: 'Argentina' repository.commit author: 'User', message: 'Commit message' repository[:countries].update 'AR', name: 'Republica Argentina' reverted_delta = repository.revert reverted_delta.must_equal 'countries' => {'AR' => {'action' => 'update', 'data' => {'name' => 'Argentina'}}} repository.wont_be :changes? end it 'Delete' do repository[:countries].insert 'AR', name: 'Argentina' repository.commit author: 'User', message: 'Commit message' repository[:countries].delete 'AR' reverted_delta = repository.revert reverted_delta.must_equal 'countries' => {'AR' => {'action' => 'insert', 'data' => {'name' => 'Argentina'}}} repository.wont_be :changes? end end
Version data entries
17 entries across 17 versions & 1 rubygems