Sha256: 40ce993467bfd26efe23e517005dbac60c86b37cd5a9ddcb62d0fcfac63a0901

Contents?: true

Size: 1.52 KB

Versions: 13

Compression:

Stored size: 1.52 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.must_respond_to(:null_attributes) }
        it { subject.null_model.must_equal(Vedeu::Repositories::ModelTestClass) }
        it { subject.null_attributes.must_equal({}) }
      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

13 entries across 13 versions & 1 rubygems

Version Path
vedeu-0.6.71 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.70 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.69 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.68 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.67 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.66 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.65 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.64 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.63 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.62 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.61 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.60 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.59 test/lib/vedeu/repositories/registerable_test.rb