Sha256: 833e271d7f933c7319cebf6d916f5f5ffbed3006fef2206532df7258bd4fdf6f

Contents?: true

Size: 1.39 KB

Versions: 11

Compression:

Stored size: 1.39 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
    after { Vedeu.interfaces.reset }

    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
        # @todo
        # it { skip }
      end

      context 'when the buffer is already registered' do
        # @todo
        # it { skip }
      end
    end

  end # DisplayBuffer

end # Vedeu

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
vedeu-0.4.61 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.60 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.59 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.58 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.57 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.56 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.55 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.54 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.53 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.52 test/lib/vedeu/buffers/display_buffer_test.rb
vedeu-0.4.51 test/lib/vedeu/buffers/display_buffer_test.rb