Sha256: c1921cd7871a478084781dc9a6ee4457b09d8c56feb4f6ecc00294b7a4730d01

Contents?: true

Size: 1.48 KB

Versions: 13

Compression:

Stored size: 1.48 KB

Contents

# frozen_string_literal: true

require 'test_helper'

module Vedeu

  describe Repositories do

    let(:described) { Vedeu::Repositories }

    describe '.all' do
      # let(:expected) {
      #   [
      #     Vedeu::Cursors::Repository.new,
      #     Vedeu::Buffers::Repository.new,
      #     Vedeu::Groups::Repository.new,
      #     Vedeu::Interfaces::Repository.new,
      #   ]
      # }

      subject { described.all }

      # it { subject.must_equal(expected) }
    end

    describe '.register' do
      subject { described.register(klass) }

      context 'when the klass is nil' do
        let(:klass) {}

        it { subject.must_equal(nil) }
      end

      context 'when the klass is a repository class' do
        let(:klass) { Vedeu::Buffers::Repository }

        it { subject.wont_be_empty }
      end
    end

    describe '.registered' do
      before {
        Vedeu.stubs(:log)
        described.reset!
      }

      subject { described.registered }

      # context 'when there is nothing registered' do
      #   let(:expected) { [[], [], [], []] }

      #   it { subject.must_equal(expected) }
      # end
    end

    describe '.repositories' do
      subject { described.repositories }

      it { Vedeu.must_respond_to(:repositories) }

      it { subject.must_equal(described) }
    end

    describe '.reset!' do
      subject { described.reset! }

      it { described.must_respond_to(:reset) }
      it { subject.must_equal(true) }
    end

  end # Repositories

end # Vedeu

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
vedeu-0.8.32 test/lib/vedeu/repositories/repositories_test.rb
vedeu-0.8.31 test/lib/vedeu/repositories/repositories_test.rb
vedeu-0.8.30 test/lib/vedeu/repositories/repositories_test.rb
vedeu-0.8.29 test/lib/vedeu/repositories/repositories_test.rb
vedeu-0.8.28 test/lib/vedeu/repositories/repositories_test.rb
vedeu-0.8.27 test/lib/vedeu/repositories/repositories_test.rb
vedeu-0.8.26 test/lib/vedeu/repositories/repositories_test.rb
vedeu-0.8.25 test/lib/vedeu/repositories/repositories_test.rb
vedeu-0.8.24 test/lib/vedeu/repositories/repositories_test.rb
vedeu-0.8.23 test/lib/vedeu/repositories/repositories_test.rb
vedeu-0.8.22 test/lib/vedeu/repositories/repositories_test.rb
vedeu-0.8.21 test/lib/vedeu/repositories/repositories_test.rb
vedeu-0.8.20 test/lib/vedeu/repositories/repositories_test.rb