Sha256: cb0319bad228042ab2fc97d6b37f8acd3b6011870a2150bc8e389993bf6d8f79

Contents?: true

Size: 1.54 KB

Versions: 5

Compression:

Stored size: 1.54 KB

Contents

# frozen_string_literal: true

require 'test_helper'

module Vedeu

  module Repositories

    describe Model do

      let(:described)          { Vedeu::Repositories::Model }
      let(:included_described) { Vedeu::Repositories::ModelTestClass }
      let(:included_instance)  { included_described.new(attributes) }
      let(:attributes) {
        {
          name: 'hydrogen'
        }
      }

      describe '#repository' do
        it { included_instance.must_respond_to(:repository) }
      end

      describe '#repository=' do
        it { included_instance.must_respond_to(:repository=) }
      end

      describe '.build' do
        let(:attributes) {}

        subject { included_described.build(attributes) { } }

        # @todo Add more tests.
        # it { skip }
      end

      describe '.repository' do
        let(:klass) {}

        subject { included_described.repository(klass) }

        # @todo Add more tests.
        # it { skip }
      end

      describe '.store' do
        let(:klass) {}

        context 'when a block is given' do
          subject { included_described.store(klass) }
        end

        context 'when a block is not given' do
          subject { included_described.store(klass) { :some_proc } }
        end

        # @todo Add more tests.
        # it { skip }
      end

      describe '#store' do
        subject { included_instance.store }

        it 'returns the model' do
          subject.must_be_instance_of(Vedeu::Repositories::ModelTestClass)
        end
      end

    end # Model

  end # Repositories

end # Vedeu

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vedeu-0.8.15 test/lib/vedeu/repositories/model_test.rb
vedeu-0.8.14 test/lib/vedeu/repositories/model_test.rb
vedeu-0.8.13 test/lib/vedeu/repositories/model_test.rb
vedeu-0.8.12 test/lib/vedeu/repositories/model_test.rb
vedeu-0.8.10 test/lib/vedeu/repositories/model_test.rb