Sha256: 45e711b992ecc1a92fdfcf13e75e3164a7541e783bd93d5f859a77bc44c76f50

Contents?: true

Size: 1.12 KB

Versions: 4

Compression:

Stored size: 1.12 KB

Contents

require 'test_helper'

module Vedeu

  describe Buffers do

    let(:described) { Vedeu::Buffers }
    let(:instance)  { described.buffers }

    describe '.buffers' do
      subject { instance }

      it { subject.must_be_instance_of(described) }
    end

    describe '#clear' do
      let(:_name)  { 'silicon' }
      let(:buffer) { Vedeu::Buffer.new }

      subject { instance.clear(_name) }

      context 'when the buffer exists' do
        before { instance.stubs(:find!).returns(buffer) }

        it { buffer.expects(:clear); subject }
      end

      context 'when the buffer does not exist' do
        it { proc { subject }.must_raise(ModelNotFound) }
      end
    end

    describe '#render' do
      let(:_name) { 'silicon' }
      let(:buffer) { Vedeu::Buffer.new }

      subject { instance.render(_name) }

      context 'when the buffer exists' do
        before { instance.stubs(:find!).returns(buffer) }

        it { buffer.expects(:render); subject }
      end

      context 'when the buffer does not exist' do
        it { proc { subject }.must_raise(ModelNotFound) }
      end
    end

  end # Buffers

end # Vedeu

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vedeu-0.4.17 test/lib/vedeu/repositories/repositories/buffers_test.rb
vedeu-0.4.16 test/lib/vedeu/repositories/repositories/buffers_test.rb
vedeu-0.4.15 test/lib/vedeu/repositories/repositories/buffers_test.rb
vedeu-0.4.14 test/lib/vedeu/repositories/repositories/buffers_test.rb