Sha256: 100201f1c6faac65dfbbd4d82741750f0f50bcf22b45cc53977f403d0c9a3a23

Contents?: true

Size: 1.22 KB

Versions: 44

Compression:

Stored size: 1.22 KB

Contents

require 'test_helper'

module Vedeu

  describe Registerable do

    class RegisterableTestClass

      include Vedeu::Registerable

      null Vedeu::ModelTestClass
      real Vedeu::ModelTestClass

    end

    let(:described) { Vedeu::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::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::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 # Vedeu

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
vedeu-0.6.10 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.9 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.8 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.7 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.6 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.5 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.4 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.3 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.2 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.1 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.6.0 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.5.13 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.5.12 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.5.11 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.5.10 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.5.9 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.5.8 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.5.7 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.5.6 test/lib/vedeu/repositories/registerable_test.rb
vedeu-0.5.5 test/lib/vedeu/repositories/registerable_test.rb