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.69 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.68 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.67 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.66 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.65 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.64 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.63 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.62 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.61 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.60 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.59 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.58 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.57 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.56 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.54 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.53 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.52 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.51 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.50 test/lib/vedeu/cursors/repository_test.rb
vedeu-0.6.49 test/lib/vedeu/cursors/repository_test.rb