Sha256: 0dc7eca26ad2204e81c91edf3b385c1bbff433ec1ad842664c2b44fd8bfd3be9

Contents?: true

Size: 1.41 KB

Versions: 47

Compression:

Stored size: 1.41 KB

Contents

require 'test_helper'

module Vedeu

  module Repositories

    describe Registerable do

      class RegisterableTestClass

        include Vedeu::Repositories::Registerable

        null Vedeu::Repositories::ModelTestClass
        real Vedeu::Repositories::ModelTestClass

      end

      let(:described) { Vedeu::Repositories::Registerable }

      it { RegisterableTestClass.must_respond_to(:repository) }
      it { RegisterableTestClass.must_respond_to(:register) }

      describe '.null' do
        subject { RegisterableTestClass.new }

        it { RegisterableTestClass.must_respond_to(:null) }

        it { subject.must_respond_to(:null_model) }
        it { subject.null_model.must_equal(Vedeu::Repositories::ModelTestClass) }
      end

      describe '.real' do
        subject { RegisterableTestClass.new }

        it { RegisterableTestClass.must_respond_to(:real) }

        it { subject.must_respond_to(:model) }
        it { subject.model.must_equal(Vedeu::Repositories::ModelTestClass) }
      end

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

        before { RegisterableTestClass.stubs(:register) }

        it { RegisterableTestClass.must_respond_to(:reset!) }
        it { RegisterableTestClass.must_respond_to(:reset) }

        it {
          RegisterableTestClass.expects(:register)
          subject
        }
      end

    end # Registerable

  end # Repositories

end # Vedeu

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
vedeu-0.6.37 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.36 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.35 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.34 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.33 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.32 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.31 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.30 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.29 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.28 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.27 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.26 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.25 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.24 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.23 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.22 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.21 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.20 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.19 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.18 test/lib/vedeu/repositories/registerable_test.rb