Sha256: d23c33f4ab67236baf9f926a5656e4d9eb0e5e93940bcd7f019b1b46af272ab4

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

require 'test_helper'

module Vedeu

  describe Buffers do

    before { Buffers.reset }

    describe '.add' do
      it 'returns the name of the buffer added to storage' do
        Buffers.add({ name: 'molybdenum' }).must_equal('molybdenum')
      end

      it 'raises an exception if the attributes does not have a :name key' do
        attributes = { no_name_key: '' }

        proc { Buffers.add(attributes) }.must_raise(MissingRequired)
      end

      context 'when the buffer is already registered' do
        it 'retrieves the buffer in storage, and adds the attributes to the ' \
        'back buffer, preserving the front which may already have content' do
          skip
        end
      end

      context 'when the buffer was not registered' do
        it 'stores a new buffer by name, and adds the attributes to the back ' \
        'buffer' do
          skip
        end
      end
    end

    describe '.update' do
      let(:buffer) { Buffer.new({ name: 'einsteinium' }) }

      subject { Buffers.update(buffer) }

      it { subject.must_equal(true) }
    end

  end # Buffers

end # Vedeu

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.2.10 test/lib/vedeu/repositories/buffers_test.rb
vedeu-0.2.9 test/lib/vedeu/repositories/buffers_test.rb