Sha256: a0a1d129023547132d2f1538ffe7a98d689595acb76a798b9b3cbfc580668941

Contents?: true

Size: 1.25 KB

Versions: 19

Compression:

Stored size: 1.25 KB

Contents

# frozen_string_literal: true

require 'test_helper'

module Vedeu

  module Cursors

    describe Repository do

      let(:described) { Vedeu::Cursors::Repository }

      it { described.must_respond_to(:cursors) }

      describe '.cursor' do
        before { Vedeu::Models::Focus.reset }

        subject { Vedeu.cursor }

        context 'when there are cursors are defined' do
          before do
            Vedeu.cursors.reset
            Vedeu::Cursors::Cursor.store(name: 'Vedeu.cursor')
            Vedeu::Models::Focus.add('Vedeu.cursor')
          end

          it 'returns the cursor of the interface/view currently in focus' do
            subject.must_be_instance_of(Vedeu::Cursors::Cursor)
          end
        end

        context 'when there are no cursors defined' do
          before {
            Vedeu::Models::Focus.add('Vedeu.cursor')
            Vedeu.cursors.reset
          }

          it do
            subject.must_be_instance_of(Vedeu::Cursors::Cursor)
          end
        end

        context 'when there are no interfaces or views defined' do
          it 'returns an unnamed cursor' do
            subject.must_be_instance_of(Vedeu::Cursors::Cursor)
          end
        end
      end

    end # Repository

  end # Cursors

end # Vedeu

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
vedeu-0.8.20 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.8.19 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.8.18 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.8.17 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.8.16 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.8.15 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.8.14 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.8.13 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.8.12 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.8.10 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.8.9 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.8.8 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.8.7 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.8.6 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.8.5 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.8.4 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.8.3 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.8.2 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.8.1 test/lib/vedeu/cursors/repository_test.rb