Sha256: 64fe339892483466d649ba72c82527fe291bf9770866c41c34dc95baf450b2d4
Contents?: true
Size: 1.71 KB
Versions: 2
Compression:
Stored size: 1.71 KB
Contents
require 'test_helper' module Vedeu describe Registrar do before do Buffers.reset Interfaces.reset Groups.reset Focus.reset end describe '.record' do let(:attributes) { { name: 'mendelevium', group: 'elements' } } it 'raises an exception if the attributes does not have a :name key' do attributes = { no_name_key: '' } proc { Registrar.record(attributes) }.must_raise(MissingRequired) end it 'raises an exception if the value for :name is nil' do attributes = { name: nil } proc { Registrar.record(attributes) }.must_raise(MissingRequired) end it 'raises an exception if the value for :name is empty' do attributes = { name: '' } proc { Registrar.record(attributes) }.must_raise(MissingRequired) end it 'sends the attributes to the Buffers repository' do Registrar.record(attributes) Buffers.registered?('mendelevium').must_equal(true) end it 'sends the attributes to the Interfaces repository' do Registrar.record(attributes) Interfaces.registered?('mendelevium').must_equal(true) end it 'sends the attributes to the Cursors repository' do Registrar.record(attributes) Cursors.registered?('mendelevium').must_equal(true) end it 'sends the attributes to the Groups repository' do Registrar.record(attributes) Groups.registered?('elements').must_equal(true) end it 'sends the attributes to the Focus repository' do Registrar.record(attributes) Focus.registered?('mendelevium').must_equal(true) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
vedeu-0.2.3 | test/lib/vedeu/support/registrar_test.rb |
vedeu-0.2.2 | test/lib/vedeu/support/registrar_test.rb |