Sha256: 93ddbd10d72d5d785f9d04dac7a4c93e6673f44b4b37a2532385f049d2f7910b

Contents?: true

Size: 1.37 KB

Versions: 1

Compression:

Stored size: 1.37 KB

Contents

require 'test_helper'

module Vedeu

  module Repositories

    describe Model do

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

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

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

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

        subject { described.build(attributes) { } }

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

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

        subject { described.repository(klass) }

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

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

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

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

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

      describe '#store' do
        subject { 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

1 entries across 1 versions & 1 rubygems

Version Path
vedeu-0.8.0 test/lib/vedeu/repositories/model_test.rb