Sha256: eec9f90fa9df4517bf70078d434a0c8c7c37de88538e9db27e3a1cfe649af829

Contents?: true

Size: 1.16 KB

Versions: 36

Compression:

Stored size: 1.16 KB

Contents

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 {
            subject.must_be_instance_of(Vedeu::Cursors::Cursor)
          }
        end

        context 'when there are no interfaces or views defined' do
          it { proc { subject }.must_raise(Vedeu::Error::Fatal) }
        end
      end

    end # Repository

  end # Cursors

end # Vedeu

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
vedeu-0.6.48 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.47 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.46 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.45 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.44 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.43 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.42 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.41 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.40 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.39 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.38 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.37 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.36 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.35 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.34 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.33 test/lib/vedeu/cursors/repository_test.rb