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.58 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.57 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.56 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.54 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.53 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.52 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.51 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.50 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.49 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.48 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.47 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.46 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.45 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.44 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.43 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.42 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.41 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.40 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.39 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.38 test/lib/vedeu/repositories/registerable_test.rb