Sha256: 593f3c5025cbcc617317daf11a1c948b259d4499dd34f088adabd8531ab525d0

Contents?: true

Size: 1.87 KB

Versions: 27

Compression:

Stored size: 1.87 KB

Contents

# frozen_string_literal: true

require 'test_helper'

module Vedeu

  module Buffers

    describe View do

      let(:described)  { Vedeu::Buffers::View }
      let(:instance)   { described.new(attributes) }
      let(:_name)      { :vedeu_buffers_view }
      let(:attributes) {
        {
          name: _name,
        }
      }

      describe '#initialize' do
        it { instance.must_be_instance_of(described) }

        context 'when a name is given' do
          it { instance.instance_variable_get('@name').must_equal(_name) }
        end

        context 'when a name is not given' do
          let(:_name) {}

          it { instance.instance_variable_get('@name').must_equal(nil) }
        end
      end

      describe '#attributes' do
        subject { instance.attributes }

        it { subject.must_be_instance_of(Hash) }
        it { subject.must_equal(attributes) }
      end

      describe '#each' do
        # @todo Add more tests.
      end

      describe '#reset!' do
        subject { instance.reset! }

        it { subject.must_be_instance_of(described) }
      end

      describe '#update' do
        let(:value_or_values) {}

        subject { instance.update(value_or_values) }

        it { subject.must_be_instance_of(described) }

        context 'when given a single value' do
          let(:value_or_values) {}

          context 'when the value is valid' do
            # @todo Add more tests.
          end

          context 'when the value is not valid' do
            # @todo Add more tests.
          end
        end

        context 'when given multiple values' do
          let(:value_or_values) {}

          context 'when the value is valid' do
            # @todo Add more tests.
          end

          context 'when the value is not valid' do
            # @todo Add more tests.
          end
        end
      end

    end # View

  end # Buffers

end # Vedeu

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
vedeu-0.8.32 test/lib/vedeu/buffers/view_test.rb
vedeu-0.8.31 test/lib/vedeu/buffers/view_test.rb
vedeu-0.8.30 test/lib/vedeu/buffers/view_test.rb
vedeu-0.8.29 test/lib/vedeu/buffers/view_test.rb
vedeu-0.8.28 test/lib/vedeu/buffers/view_test.rb
vedeu-0.8.27 test/lib/vedeu/buffers/view_test.rb
vedeu-0.8.26 test/lib/vedeu/buffers/view_test.rb
vedeu-0.8.25 test/lib/vedeu/buffers/view_test.rb
vedeu-0.8.24 test/lib/vedeu/buffers/view_test.rb
vedeu-0.8.23 test/lib/vedeu/buffers/view_test.rb
vedeu-0.8.22 test/lib/vedeu/buffers/view_test.rb
vedeu-0.8.21 test/lib/vedeu/buffers/view_test.rb
vedeu-0.8.20 test/lib/vedeu/buffers/view_test.rb
vedeu-0.8.19 test/lib/vedeu/buffers/view_test.rb
vedeu-0.8.18 test/lib/vedeu/buffers/view_test.rb
vedeu-0.8.17 test/lib/vedeu/buffers/view_test.rb
vedeu-0.8.16 test/lib/vedeu/buffers/view_test.rb
vedeu-0.8.15 test/lib/vedeu/buffers/view_test.rb
vedeu-0.8.14 test/lib/vedeu/buffers/view_test.rb
vedeu-0.8.13 test/lib/vedeu/buffers/view_test.rb