Sha256: 8ca2a54b38efabb046f000f875ef29ae01a7341076434e66f47b1425bebb1468

Contents?: true

Size: 1.28 KB

Versions: 16

Compression:

Stored size: 1.28 KB

Contents

require 'test_helper'

module Vedeu

  class TestInterfaceModel
    include Vedeu::Model
    include Vedeu::DisplayBuffer

    def colour
      Vedeu::Colour.new(background: '#000000', foreground: '#ffffff')
    end

    def name
      'test_interface_model'
    end

    def style
      Vedeu::Style.new(:normal)
    end

    private

    def repository
      Vedeu.interfaces
    end
  end

  describe DisplayBuffer do

    let(:described)        { Vedeu::DisplayBuffer }
    let(:example_model)    { Vedeu::TestInterfaceModel }
    let(:example_instance) { example_model.new }

    before do
      example_instance.store

      Vedeu::Refresh.stubs(:by_name)
    end

    describe '#store_immediate' do
      subject { example_instance.store_immediate }

      it { subject.must_be_instance_of(example_model) }
    end

    describe '#store_deferred' do
      subject { example_instance.store_deferred }

      it { subject.must_be_instance_of(example_model) }

      context 'when the name is not defined' do
        before { example_instance.stubs(:name) }

        it { proc { subject }.must_raise(InvalidSyntax) }
      end

      context 'when the buffer is not already registered' do
      end

      context 'when the buffer is already registered' do
      end
    end

  end # DisplayBuffer

end # Vedeu

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
vedeu-0.4.29 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.28 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.27 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.26 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.25 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.24 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.23 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.22 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.21 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.20 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.19 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.18 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.17 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.16 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.15 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.14 test/lib/vedeu/buffers/display_buffer_test.rb